Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#812692
You can't use ProcessMaker variables that way.

You can do is this in a trigger, which is similar:
Code: Select all
$i=1;
$varName = 'test_'.$i;

$c = new Cases();
$aCase = $c->loadCase(@@APPLICATION, @%INDEX);
if (isset($aCase['APP_DATA'][$varName])) {
   $val = $aCase['APP_DATA'][$varName];
   echo $val; 
} 
Or in a plugin, you can load a case this way:
Code: Select all
$aCase = $c->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
 
Just remember that the variable test_1 must already be saved to the database in the APPLICATION.APP_DATA field when you call Cases::loadCase(). If you call this immediately after a dynaform which sets the variable test_1, then it hasn't yet been saved to the database. It is best to set your trigger to fire before the next step in the task or the before assignment, if the Dynaform is the last step in the task, so that the variables are already saved in the database. The other workaround is to call PMFSendVariables or Cases::updateCase() to save the variable to the database before using the above code.
Designer not loading...

Okay after many, many, MANY hours.... I found […]

The Drip casino clone script enables entrepreneurs[…]

Create a cutting-edge crypto sports betting platfo[…]

Betdaq Clone Script is a ready-to-launch solution […]