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 / Need help to compare t...
Power Automate
Answered

Need help to compare the list items and then do an action based on the output.

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

Flow Details: I am having a flow that gets the data from email and create a item in SPO List. And the column names are Record Number, City, Country and so on. I was getting multiple emails for one record number and at that time the flow need to check If the record number is existing or not in the SPO list.

Actions:

  • If the record number is already exists in the list, then need to just update the Column values
  • If the record number is not found, then need to create an item in the list.

Any suggestions on the condition part..

Thank you.

             

Categories:
  • Verified answer
    henkenTech Profile Picture
    135 on at
    • When you get your items, add an OData filter for the Record id (ColumnName eq 'RecordId').
    • Then, in your condition, count the returned items using the length() function and use the greater than condition with a 0 on the other side. When the item is not yet in the list, the No branch of the condition will be activated and the other if the item is already in the list.
    • Then, use a Create Item and Update Item respecitvely.

    Hope this help 🙂

  • Verified answer
    Ellis Karim Profile Picture
    12,277 Super User 2026 Season 2 on at

    For the record number, you should check that the SP list ensures that there are no duplicate Record numbers:

    ekarim2020_5-1625414759242.png

    It probably needs to be a required field too:

    ekarim2020_7-1625414968866.png

    Filter query can be used to Get Items (uses oData filters to construct the query):

    ekarim2020_2-1625414153320.png

     

    Use a condition to check to see if any records are returned:

    If length(outputs('Get_items')?['body/value']) is greater 0 - that means a record was returned by the filter:

    ekarim2020_12-1625416775395.png

     

    Note that even though only one record is returned, Get Items returns an array, which Power Automate will need to cycle through, hence the use of Apply to each loop.
     
    I hope this helps.

     

    Ellis

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 233 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 136 Super User 2026 Season 2

Last 30 days Overall leaderboard