web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help to get number of ...
Power Automate
Unanswered

Help to get number of items in a list!

(0) ShareShare
ReportReport
Posted on by 33

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

Categories:
I have the same question (0)
  • PieterVeenstra Profile Picture
    13 on at
    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.

  • Verified answer
    v-bacao-msft Profile Picture
    on at
    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

  • GabrielStJohn Profile Picture
    on at
    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

  • Community Power Platform Member Profile Picture
    on at
    Re: Help to get number of items in a list!

    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 ?

     

    flow.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard