Hi,
I am working in a Flow that should counts the number of items in a list that has repeated value on other words I have a list that contains a calculated column to get the number of the week. In this list should not accept more than 5 items with the same week number so I am trying to create a Flow to avoid create new items if the number of the same week is larger than 5.
Right now I have a Flow that counts all the items and I don't know how to check how many items exists with the same week number.
Here the "indata" is giving me the total of items in the list without checking the week number. How add the logic to check if the number of the same week is larger than 5?
Best regards
Americo
Solved! Go to Solution.
Hi @SpDev,
I did a test on my side, it seems that it can't use Calculate column in Filter Query.
Maybe you could consider using variables to implement the requirements, initialize a variable of type Integer
Use the value of the week number in the trigger to compare with the week number of all items in the list. If they are equal, the variable is incremented by one.
Finally, compare the value of the variable to greater than 5. If it is greater than 5, delete the item you just created.
Image reference:
Please take a try and let me know if you have any question.
Best Regards,
Barry
You woul have to run an additonal get items with a filter set. Then have two length functions that you can compare.
Hi @SpDev,
I did a test on my side, it seems that it can't use Calculate column in Filter Query.
Maybe you could consider using variables to implement the requirements, initialize a variable of type Integer
Use the value of the week number in the trigger to compare with the week number of all items in the list. If they are equal, the variable is incremented by one.
Finally, compare the value of the variable to greater than 5. If it is greater than 5, delete the item you just created.
Image reference:
Please take a try and let me know if you have any question.
Best Regards,
Barry
Hello, @SpDev!
Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-bacao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!
Thank you for being an active member of the Flow Community!
-Gabriel
Flow Community Manager
I'm tying something similar, whenever I create an item to SP, I check if 3 items are already there.
If yes I'd like to remove the newly added item.
The result, however, is that when I add a 4th item, the 3rd gets removed and the 4th added.
What's wrong ?
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
40 | |
37 | |
36 | |
35 | |
28 |
User | Count |
---|---|
39 | |
39 | |
34 | |
30 | |
23 |