AnsweredAssumed Answered

Set Variable Name by Calculation

Question asked by taylorsharpe on Feb 20, 2019
Latest reply on Feb 20, 2019 by wimdecorte

We have Set Field Name by Calculation, but nothing where we can set a variable name by calculation.  I've several times run into when it would be convenient to Set Variable by Calculation. 

 

The case scenario I have today is a print job.  Due to iOS, Mac and Windows all needing to print, we send the print jobs to a Print Que table in FM and the robot machine next to the server does all of the printing and has all the necessary print drivers, etc.  Works really great especially for iOS guys in the field.  However, some print jobs need global variables and when you print from the robot machine, those global variables do not go with the print job.  So I send them via a Variables field in the print que that is done in JSON.  Works great except that on the print que, I can't set a variable by name.  I have the JSONListKeys that lists the variables.  But I have to manually hard code them since I can't calculate them on the robot print FMPA machine. 

 

So, instead of a loop going through JSON Keys, I instead have to hard code each possible global variable in.  I still get to pass the variable data which is useful, but instead of a nice neat loop, I have to have a long string of every variable I possibly want passed. 

 

Of course maybe it would be nice to have an option when calling a subscript to set its variables to be those in the parent script when you call a perform script step.  Still, I'd like to be able to set variable by name. 

Outcomes