I would like to be able to +1 to a value in an existing field once the flow has run so I can prevent it from looping everytime it's modified but I can't figure out the expression. It's probably very simple but I'm just going in circles at the moment so any help would be greatly appreciated!
Hi @ TomGothard1992,
Could you please share a screenshot of the configuration of your flow?
Could you please share more details about the value in an existing field that you want to add 1? Does the existing field is a field in your sharepoint list?
If the existing field is a field in your sharepoint list, what is the type of the field in your sharepoint list? Is it a Number type of column?
Could you please explain more about "+1 to a value in an existing field once the flow has run so I can prevent it from looping everytime it's modified" that you mentioned?
For you question to add 1 to an existing field, I have made a test on my sideand create a sharepoint list with a number type of column "number".
You could create a flow refer to screenshot below to:
The expression in the "numder" field of "Update item" action as below:
When an item is created or modified, and you could check the value in the number column, if the value in the number column is equal to 0, the flow would add 1 to the value in the number column in the list, the flow would run successfully as below:
Thanks for your response it has worked in preventing the flow from looping. The only issue is that (I'm assuming) now it doesn't loop, and therefore fails, it doesn't actually update the original item. Any help would be greatly appreciated.
I've attached the images below as I couldn't work out how to screenshot them in here.
You could do a Do Until action that checks whether the Modified action is equal to true.
So something like this:
*Note: You have to use an expression to set the value True. Otherwise it will always return false.
See the attachments for screenshots to understand it better.
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.
Do you want to prevent the start an approval action from run twice when you use the trigger "When an item is created or modified" and you would update the item in the flow?
You could take a try to add a choice type column in your sharepoint list named "modified by flow" with to chlice "Yes"and "No", and set the default value to No.
When the uer create or update an item in the shrepoint list, he should set the "modified by flow" column to "No".
And in the "Update item" action of the flow, set the "modified by flow" column to "Yes".
So you could prevent the start an approval action from run twice by add a condition under the trigger to check if the value of "modified by flow" column is equal to Yes.
If the "modified by flow" column is equal to Yes,do nothing, if the "modified by flow" column isn't equal to Yes, do something you want.
I have tried this and whilst it does prevent it from looping, it results in the flow failing and therefore not actually updating the item at all.
I'll add some more screenshots, can you advise further or test it at your end?
Could you please share a screenshot of the error when the flow run failed?
Or could you please share more details about the error?
Which action run failed when the flow runs?
Check out the new Process Advisor community forum board!
Check out new user group experience and if you are a leader please create your group
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks