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 / Error when using Get I...
Power Automate
Answered

Error when using Get Items to query a list

(0) ShareShare
ReportReport
Posted on by 55

Hello Guys, Hope You can help with this one. 

 

I have a flow that needs to check if an item already exist on a Master list, if the item exist then update it, if it doesn't exist then create the item. 

 

The issue I have is when I use a "Get Items" to query the "Master List" it goes through every single item in the "Master List" checking if the values match, if they don't match then it creates the item, BUT then it moves to the next item and it tries to create it again, and again for each item it checks. it seems that is not checking the entire list and choosing to create the item or update it after it checks the list. It does this 100 times and then it fails because some of the values are unique.Flow1.JPG 


 Flow2.JPGFlow3.JPG

 

Categories:
I have the same question (0)
  • PieterVeenstra Profile Picture
    31 on at
    I've created a post on this. earlier this week. https://veenstra.me.uk/2018/12/03/microsoft-flow-import-list-data-from-an-excel-spreadsheet-into-sharepoint-lists/ To do this include a query in your get items. Then check for the number of items found then have a condition that either creates or updates the lists items.
  • DemoMan Profile Picture
    55 on at
    Hi Pieter, Thanks so much for your reply. I see that you are using the: @equals(length(body(‘Get_items_2’)?[‘value’]), 0) I'm using a similar string on my flow: @equals(length(body('Get_items')?['value']), 1) But I'm not sure this works for me, my flow checks the first item on the list for the value I'm looking for and when it sees that is not the same value I'm looking for it creates my item, it then moves to the next item and it sees that the item doesn't have the value I'm looking so it tries to create the item again, only that this time it fails because the item was already created on the flow's first run. Does your flow check all items until it finds the one that matches your value and then stops?
  • Verified answer
    PieterVeenstra Profile Picture
    31 on at
    The selection of the item in Get_Items ( using the filter field in the advanced settings) sorts out that I will only get 1 item or no items back. Checking for 0 might not work as a list of no items might mean that the length function will fail. What will length (null) return? In general I add a few compose actions to my logic so that I can debug the solutions. Can you add 2 compose actions just before your condition. set the first compose to the following expression: body(‘Get_items_2’)?[‘value’] and the second one to: length(body(‘Get_items_2’)?[‘value’]) Now you will know what the values are that are failing.
  • Verified answer
    v-yuazh-msft Profile Picture
    Microsoft Employee on at

    Hi @DemoMan,

     

    I have made a test on my side, please refer to screenshot below to create the flow:

    Capture.PNG

    Capture.PNG

     

    Best regards,

    Alice

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard