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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard