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.
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]