Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Condition errors when get items return empty Sharepoint record

(0) ShareShare
ReportReport
Posted on by 15

Hi,

I'm building a flow getting records from one Sharepoint list (List 1), then use the Title field from List 1 to search for records from another Sharepoint list (List 2). If Title field in List 2 matched, update List 2 data. If it's not, create new record in List 2 with List 1 data. The problem I have is when Get Items return empty records from List 2, it return errors shown in red highlighted. 

Flow error 1.png

and I use

Flow error 2.png

 

Would anyone please share with me your knowledge on how to resolve this issue.

Thank you.

  • lechrisvan Profile Picture
    15 on at
    Re: Condition errors when get items return empty Sharepoint record

    Thank you both Hardersh15 and abm helping me on this issue. The problem was my looping. It took Hardersh15 suggestion but did not do it properly. I revised my design again and it works as shown.

    Flow error 4.png

    Thank you.

  • lechrisvan Profile Picture
    15 on at
    Re: Condition errors when get items return empty Sharepoint record

    Hi abm,

    This is what i got for the empty record. The error message appears very blur. 

    Flow error 3.png

  • abm abm Profile Picture
    32,464 Most Valuable Professional on at
    Re: Condition errors when get items return empty Sharepoint record

    Hi @lechrisvan 

     

    What error are you getting? Could you please post it?

     

    Thanks

  • lechrisvan Profile Picture
    15 on at
    Re: Condition errors when get items return empty Sharepoint record

    Thank you Hardesh15. I tried your suggestion but it did not work either. A query for List 2 must be executed for each List 1 returned record. It has to validate whether the same record of List 1 exists in List 2.

    Any other suggestions?

    Thank you.

  • lechrisvan Profile Picture
    15 on at
    Re: Condition errors when get items return empty Sharepoint record

    Thank you abm for such quick response.

    The issue I have is not Null Field. It's rather empty record return. I tried to use the function empty(body('Get_items_2')?['value']) and it also returns the error. Do you have any other hint?

    Thank you.

  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Condition errors when get items return empty Sharepoint record

    @lechrisvan Please put you condition out side Apply to each 2. Better use one compose after get items 2 and create length function then use condition and when you will pass ID in update item it will apply loop only to update item action.

    Please 'Thumbs Up' the posts that helped you and 'Mark as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • abm abm Profile Picture
    32,464 Most Valuable Professional on at
    Re: Condition errors when get items return empty Sharepoint record

    Hi @lechrisvan 

     

    Try to use the coalesce expression where you can default the values for nulls.

     

    Please see this video for how to use Coalesce expression.

     

    https://www.flowjoe.io/2021/04/30/power-automate-functions-coalesce-handle-null-values-from-objects/

     

    Thanks

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow