Hello,
I have a question regarding an incremental variable I implemented in my flow.
I tested it and the value shows what I'm asking, i.e. 1, as this is the first one. If I run a test again, it still shows 1 for the newly created item.
Now, my question is : if I run it live, when people will create new items, will that incremental turn into increment+1 (so 2,3,etc..)
Does somebody know about this ? or maybe tell me what I need to implement in order to run it properly ?
Thanks a lot in advance.
KR,
Laszlo
Solved! Go to Solution.
Hi @iamlaszlo
The increment variable action is valid for the particular run only. So if the flow was triggered and the variable was incremented, it will reset when the flow is triggered again and start from the value that is initialized in the variable.
If you want to track the number that way, maybe you can add a column to the SP list and update when a new item is created or use the ID of the SharePoint item on which the flow is being triggered.
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Hello @iamlaszlo ,
you can either create the list again (it'll start assigning IDs again starting from 1) or do a calculation when initializing the variable. I personally would create a copy of the existing list, then delete the old list and redirect the flow to the new one.
But if you want to continue in the current list, instead of using the ID directly in the value initialization, use calculation ID - 22 (? or other number to get number 1 with the first workflow run). There's add() expression for that.
add([ID],-22)
Note:
[ID] is the dynamic content
Hi @iamlaszlo
The increment variable action is valid for the particular run only. So if the flow was triggered and the variable was incremented, it will reset when the flow is triggered again and start from the value that is initialized in the variable.
If you want to track the number that way, maybe you can add a column to the SP list and update when a new item is created or use the ID of the SharePoint item on which the flow is being triggered.
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Hello @iamlaszlo ,
if you set the variable to 0 at the beginning of the flow and then increment it by 1, it'll be always 1 for each flow you start. Every new instance of the flow will go step by step through the flow.
If the whole meaning of the incrementing variable is to increase it by 1 for each new item, then you can use the item ID directly which is automatically incremented by 1 for each new item.
Hello,
Thank you both !
My sharepoint list looks like that.
''If the whole meaning of the incrementing variable is to increase it by 1 for each new item, then you can use the item ID directly which is automatically incremented by 1 for each new item.''
- How could I do that ? Wouldnt it be the same as what I tried to do above ?
''If you want to track the number that way, maybe you can add a column to the SP list and update when a new item is created or use the ID of the SharePoint item on which the flow is being triggered. ''
- Same here, I would add a column, but how do my flow would look like ? Do I change the value ?
Thanks in advance 🙂
Hi @iamlaszlo
The item ID is always generated fresh incremented by one number from the previously created SharePoint item and so will be different from the increment variable action which is always going to be 1 as you are incrementing it from 0.
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Hello,
I do understand what you mean, I'm just afraid I dont know how I should implement it, or where ?
Thanks for your patience and looking fwd to hearing from you.
Alright, everything works like a charm.
I understood what you mean and updated accordingly.
Now, my test phase is over, so I deleted every data, and just did a test, problem is that I can see that it's continuing (in my case giving me 22, I did 21 test before)
Any way I can reset the counter ?
Thanks in advance
Hello @iamlaszlo ,
you can either create the list again (it'll start assigning IDs again starting from 1) or do a calculation when initializing the variable. I personally would create a copy of the existing list, then delete the old list and redirect the flow to the new one.
But if you want to continue in the current list, instead of using the ID directly in the value initialization, use calculation ID - 22 (? or other number to get number 1 with the first workflow run). There's add() expression for that.
add([ID],-22)
Note:
[ID] is the dynamic content
Great ! I will go for the second solution, all of my lists are already setup in Teams, if I can use something that wont change everything, I guess it's preferable.
Thanks a lot to you both !
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
86 | |
60 | |
51 | |
44 | |
40 |
User | Count |
---|---|
87 | |
81 | |
76 | |
62 | |
44 |