cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SpDev
Level: Powered On

Help to get number of items in a list!

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. 

Flow.PNG

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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Help to get number of items in a list!

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:

18.PNG

19.PNG

20.PNG

Please take a try and let me know if you have any question.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Super User
Super User

Re: Help to get number of items in a list!

You woul have to run an additonal get items with a filter set. Then have two length functions that you can compare.

Community Support Team
Community Support Team

Re: Help to get number of items in a list!

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:

18.PNG

19.PNG

20.PNG

Please take a try and let me know if you have any question.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Administrator
Administrator

Re: Help to get number of items in a list!

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

-Gabriel
Microsoft Flow Community Manager

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 495 members 4,470 guests
Please welcome our newest community members: