I have a flow that creates a unique ID with the year 'yyyy' format, like 2019-01.
As last step, I entered the condition, that a column of my list has to contain a specific word.
The problem is that it then looks like this. After 2019-34 comes 2019-38. What I would like to have, is that after 2019-34 comes 2019-35.
Solved! Go to Solution.
Hi @Dricc, forgive me for stepping into your conversation with @ErichH but I have an alternative method in the images below which I hope you will find is a solution. The main thing is that whenever I deal with incrementing values I always save the inext value to be used, i.e the 35 you mentioned in yur first post, in a separate SharePoint list which only has that 1 item. The flow gets that number, updates the new item with it then then adds 1 to it at the end of the flow ready for the next item that meets the Condition.
In my example the Condition must be that Current is equal to Yes.
Image 5: as the number has been used in a string variable we need to convert it back to an integer ready to be saved to the increment list.
If the Condition evaluates to No then the number is not increased by 1, You can see this in the last image.
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
1-Trigger - get item
2-Compose Year Init variable
3-Get increment value to be used
4-Condition and update item
5-Convert to integer
6-add 1 to the increment value
7-Next increment value to be used if condition is yes
8-Current list with generated values
My flow looks like this. I don't know if it helps.
Are you sorting the data in the āget itemsā step by āIDā?
and
Why is the āincrement variableā step outside of the loop āapply to eachā? What is inside of the loop?
you have to
> move the "increment variable" step into the "apply to each" loop as you want to have unique numbers.
and
suggest to add in "Get items" in
> "order by" the dynamic variable ID .
> "filter by" the text generated%20number ne ''
Thanks a lot @ErichH !
just one question: what does this do and what is the dynamic variable exactly:
"order by" the dynamic variable ID
Also, the flow runs succesfully, but doesn't do what I want:
Hi @Dricc, forgive me for stepping into your conversation with @ErichH but I have an alternative method in the images below which I hope you will find is a solution. The main thing is that whenever I deal with incrementing values I always save the inext value to be used, i.e the 35 you mentioned in yur first post, in a separate SharePoint list which only has that 1 item. The flow gets that number, updates the new item with it then then adds 1 to it at the end of the flow ready for the next item that meets the Condition.
In my example the Condition must be that Current is equal to Yes.
Image 5: as the number has been used in a string variable we need to convert it back to an integer ready to be saved to the increment list.
If the Condition evaluates to No then the number is not increased by 1, You can see this in the last image.
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
1-Trigger - get item
2-Compose Year Init variable
3-Get increment value to be used
4-Condition and update item
5-Convert to integer
6-add 1 to the increment value
7-Next increment value to be used if condition is yes
8-Current list with generated values
Thank you @RobElliott !
That looks pretty good exept for the last part where the sister list is updated. I get following error:
The error message says the item doesn't exist. You must already have an item in that list.
Rob
Los Gallardos
Could you post of screenshot of the Update item action that failed so we can what the issue might be in it.
Rob
Los Gallardos
It looks to me like you've changed the list name from Trial2_sister to x4requests_sister? That might be the problem as Flow (and PowerApps) doesn't like it when list names, column names etc are changed. You could delete the connection and re-connect or perhaps delete and re-create the actions that refrence the sister list.
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Sorry I had created a copy of the flow, to test it on other lists that I have. This was the screenshot of this copy.
Here the original: I never changed the list name:
Note that I was obliged to enter something in the 'Title' column of list Trial2_sister because this column is required by default. I don't know if this can be an issue.
No that won't be the problem. For some reason it doesn't seem to be finding the list and I'm not sure why that would be happening.
Rob
Los Gallardos
@RobElliott it works now! I had the ID wrong. I had @{body('Update_item')?['ID']} instead of the @{items('Apply_to_each_2')?['ID']}
Thank you very much for your help all along.
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 |
---|---|
85 | |
57 | |
42 | |
38 | |
33 |
User | Count |
---|---|
91 | |
73 | |
72 | |
60 | |
40 |