Hello guys.
I am trying to create a macro which would update a numeric field everytime I runs the script. However there is a problem:
Yep, it is updating, but I ran the script 10 times and it does not go higher... 873204 -> 873205 -> etc.
I need it to update and save the updated value, to use it in the formula..
Is there a way of doing that?
thanks!
Solved! Go to Solution.
Hi @Joker_Hazard ,
What's the reason you are using a numeric updown tool in the macro's interface? What do you want to achieve with this? Allow the user to add a custom interval to Field 1, so instead of Field1+1 you could have Field1+ x , where x the value given by the user?
Hey,
I think is not necessary to have it... My purpose is to update the value automatically, therefore, the user would take no action...
Still, I'm no able to achieve that. Any ideas?
Oh, alright, so every time the workflow runs, you would like to get the value in Field 1 + 1, correct?
The reason you are only seeing 873203 is because your macro is not iterating, it just gets the original value (873202) and adds 1. Because the input is not updated every time the workflow runs, you're constantly getting the same result
Yep, Exactly.
The only rule is to never repeat the number, so everytime it runs, adds +1.
To make this an iterative macro, you should create a condition that will stop the macro from iterating (i.e. you can allow your user to define an end value (873210) and your macro will run until it reaches that value.
Would that work in your instance?
So @Joker_Hazard ,
I've converted that into an iterative macro, which allows the user to give a maximum number (in this example 873208) and the macro will run until it reaches that number. So you will get every row from 873202 to 873208.
Would that work, or would you prefer the user to manually have to click on run to see what's going on in each iteration?
That would work, if the files are saved in a directory.
My idea was much simpler.
Run script -> Value is updated -> File is saved.
Just to let you know, the file would be later consumed by a program, and this program does not recognize values that have already been read.
Does this makes sense to you?
Thats excellent! Can you please send me the macro? I would like to study that...
Thank you!
I'm trying to keep up @Joker_Hazard , but my question is, if you want to run the script 50 times, maybe it would have been better if you don't have to click on run button 50 times?
Not sure what the program requirements are, but does it have to read files in a directory which only contain a single row of data?