Hi, is there any way to save a variable at the end of a workflow execution and use it in the next execution of the same workflow?
I've tried with instance.vars but it doesn't work.
Solved! Go to Solution.
Hi @Heku_ ,
1) Create an option under /Administration/Platform/Options/
2) Workflow:
In get option JS, you can call the previously updated instance variable value
getOption('internalNameOfTheOption');
In setOption JS, you can update the Option value with instance variable.
instance.vars.myVariable = "abcd";
setOption ('internalNameOfTheOption', instance.vars.myVariable);
You could think to do a technical schema with these attributes
<attribute name="wkfName" label="Workflow Name" type="string"/>
<attribute name="id" label="Id" type="long"/>
Save the vars value there and query when needed
Views
Replies
Total Likes
Hope this helped, tell me if you need anything more!
Views
Replies
Total Likes
It's a solution similar to use the getOptions and setOptions, but it's not enough efficient.
You're right, getOption and setOption is the best way to go here! Do you know how to use them?
Views
Replies
Total Likes
You can also save the variable to an option and then load it in the next run:
Hi @Heku_ ,
1) Create an option under /Administration/Platform/Options/
2) Workflow:
In get option JS, you can call the previously updated instance variable value
getOption('internalNameOfTheOption');
In setOption JS, you can update the Option value with instance variable.
instance.vars.myVariable = "abcd";
setOption ('internalNameOfTheOption', instance.vars.myVariable);
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies