Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By roy501
#779585
I have a dynaform with lots(!) of variables.
I want to be able to store form data so next time the user won't have to fill it out again.

One solution I thought about is to save in another database the APP_DATA field of the APPLICATION table. and then inject it to a new case.
It works, but in this way I clone all the variables as a whole. and it is not good for me because I want to see the diff between the loaded variables to the new variables.

Is there a way to programmatically iterate through all form variables and read/set them?

Thanks
By roy501
#779613
No,
What I need is to populate all process variables from an external database.

for example, I have a variable in the process called @@text3,
From an external database i got an array of variables and values.
I want to populate the process variables from the database, something like this:

$varName ="text3";
$varValue ="Some Text";

@@$varName = $varValue;

this is not working of course, so what is the propper way to achive this?
By roy501
#779647
I found the solution, so I thought it would be worth to share

You can create an array which its keys are the name of a @@ variable. and then use the PMSendVariables function to populate the variables

code example:

$aData = array('Text1' => 'Acme Blender #2', 'Price' => 27.40, 'OrderDate' => '2010-12-31');
PMFSendVariables(@@APPLICATION, $aData);

Temu New user DIscount code Using Temu's DIscount […]

By using the Temu coupon code [acu600079], you can[…]

Yes, the Temu Coupon Code "aci384098" or[…]

Yes, the Temu Coupon Code "aci384098" do[…]