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 / Logic to Update a Look...
Power Automate
Answered

Logic to Update a Lookup Field Only When the Provided GUID is NOT Null

(0) ShareShare
ReportReport
Posted on by 82

I am trying to update rows with Lookup fields in Dataverse by passing a table of GUIDs in JSON format to power automate. Issue is, the GUID is not always provided:

CAC93_0-1639778502108.png

If I patch a null to a lookup field using the /entitysetname(key) format in the 'Update a Row' action I get an error returned:

CAC93_1-1639778591105.png

This is because it is null. 

 

My question is, is there a way to add coalesce() or if( isnull(Basis GUID) ) so that power automate can just skip this row?

 

I tried this, but power apps gives me a "Fix invalid expression(s)" error

 

CAC93_3-1639778926896.png

 

I just want to pass nothing to this field if items('Apply_to_each')['Basis GUID'] is null.

 

Categories:
I have the same question (0)
  • Verified answer
    MJain Profile Picture
    2,450 on at

    Hi @CAC-93 ,

     

    Try using the below expression : 

     

    if(empty(items('Apply_to_each')['Basis GUID'], ‘ ‘,
    concat(‘eomb_gt_bases(‘, items('Apply_to_each')['Basis GUID'],’)’))

     

    Thanks

  • CAC-93 Profile Picture
    82 on at

    Hello and thank you, this worked just as planned. The code ultimately ended up being:

    if(
     empty(items('Apply_to_each')['Basis GUID']),
     null,
     concat('/eomb_gt_bases(', items('Apply_to_each')['Basis GUID'],')')
    )

    But that is simply because I wanted null there rather than ' '.

    Additionally, you needed a '/' character before the EntitySetName "eomb_gt_bases" to complete the /EntitySetName(key) method to patch lookups.

     

    Thank you for the suggestion!

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 112 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 52

#3
Ellis Karim Profile Picture

Ellis Karim 51 Super User 2026 Season 1

Last 30 days Overall leaderboard