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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trigger Condition with...
Power Automate
Answered

Trigger Condition with Greater and Length expression

(0) ShareShare
ReportReport
Posted on by 52

I'd like to create a customized trigger condition that will fire the flow when the number of items in the list is Greater than 4000 AND "When an item is created or modified" in SharePoint. I have my condition written as 

@greater(length(triggerOutputs()?['body/value']),4000) but it is not working. Any thoughts and solutions?
 
PAuser_123_0-1717727547880.png

 

This is the error message I received: 

 

PAuser_123_0-1717728114221.png

 

 
Categories:
I have the same question (0)
  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @PAuser_1-2-3 

    If you want to judge the list is Greater than 4000 , you may need to use the [ID] column in your SharePoint List , you can use this expression:
    @greater( triggerOutputs()?['body']?['ID'] , 4000)

     

    And if you do not want to use the [ID] column, you can not judge it in your trigger. You need to add the condition after your trigger:

    vyueyunmsft_0-1717730505612.png

    /_api/web/lists/getbytitle('Your List Name')/ItemCount

    body('Send_an_HTTP_request_to_SharePoint')?['d']?['ItemCount']

     

    For more information, you can refer to :
    How to Count Items in a SharePoint List with Power Automate - Power Tech Tips

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

  • PAuser_1-2-3 Profile Picture
    52 on at

    Thanks @v-yueyun-msft. The first solution using ID doesn't work for my case because I also have a subsequent step that delete items, therefore using ID in the trigger to count number of items would give false result. 

     

    Option 2 using Send HTTP and condition steps work flawlessly for my purpose. Much appreciated!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 784

#2
Valantis Profile Picture

Valantis 589

#3
Haque Profile Picture

Haque 522

Last 30 days Overall leaderboard