Hi All,
Is it possible to capture values assigned to each of the User Constants under workflow configuration and write it to a file once the workflow is completed. Important is to capture the run time values of the constant and not the saved values in Yxmd file.
So for example there is a constant "ABC" with value as 10 saved under yxmd file but during the execution the value is changed from 10 to 20 and workflow is executed, I want to capture value as 20 for constant "ABC'.
I know there is a way to refer [User.ABC] under the formula and another field can be created which will hold the value as 20 and this can be written to an output file but the problem is I need to implement this for 70+ graphs each having individual 10-15 user defined constants. I wanted to have an automated way (Macro) for doing this task rather then creating 10-15 fields in the formula for 70+ graphs
Solved! Go to Solution.
@sg1525 This is curious use case for me and have no experience of doing this, but I come up with workaround like this.
(1) Get the name of all User Constants by referring to its workflow file and XML parsing(Blob Input=>Blob Convert).
(2) By using Dynamic Replace tool, get the current set value of User Constants
Here is the WF implementing this logic. At least in my computer, result shows the current set value of User Constants, not the value saved in WF. Please check it out.
My idea might be not immediate solution for you but hope it could inspire you somewhat. Good luck!
Perfect it works for me. Thanks a lot gawa
Hi @sg1525
Excellent solution from @gawa, leveraging the Dynamic Replace in expression\formula mode.
I submit a small fix for the case where the user constant is numeric, which caused to original workflow to error with a type mismatch.
It simply reads the IsNumeric field from the workflow xml and inserts a ToString if it is numeric
Dan
Hi Danilang,
Thanks for highlighting this point , it was error in my first run with the solution (due to numeric values in my user constant) and fixed it using tostring in the formula