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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Not able to setup lookup value to null in power automate

(0) ShareShare
ReportReport
Posted on by 60

Hi All,

I am listing an entity records which is being used to create a duplicates  of all listed records using power automate flow.

Now, the problem is this entity has got 5 lookup fields to populate to the new duplicates records, when it has got the value I am able to populate and create a new records. But not when it has null value. I cannot add the if else as it will have a lot of branching and look bad.

For example,

When contact lookup has got the value then I am using this expression and its working fine-

/contacts(Dynamic value)

 When it has null value then I am using and its giving error or blank contact even if it has contact

if(empty(items('Apply_to_each')?['body/_new_contact_value']), ' ',
concat('contacts(',items('Apply_to_each')?['body/_new_contact_value'],')'))

 

I cannot use the below expression as suggested by other members as I am fething record form APPLY to each

if(empty(triggerOutputs()?[‘body/_parentcustomerid_value’]), ‘ ‘,
concat(‘accounts(‘, triggerOutputs()?[‘body/_parentcustomerid_value’],’)’))

I have the same question (0)
  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi DevCrmUser,

    How about this 'if(equals(body('HTTP'),0),null,/contacts(body('HTTP')))'?

    pastedimage1677656551584v1.png

  • DevCrmUser Profile Picture
    60 on at

    its not coming from http but I am listing the record using List raws and fetch xml.  I mean can u please tell me explicity for my expression

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi DevCrmUser,

    Try to use it. I added null there I am thinking this is the fix.
    if(empty(items('Apply_to_each')?['body/_new_contact_value']), null,concat('contacts(',items('Apply_to_each')?['body/_new_contact_value'],')'))
  • DevCrmUser Profile Picture
    60 on at

    I think there is no way to do it as of now. It setting the value to null even we have value in account

  • Suggested answer
    pavanmanideep Profile Picture
    1,331 on at

    Hello,

    Please post this in relevant forum where Power Platform community can assist you. 

    Microsoft Power Automate Community - Power Platform Community

    Cheers,

    PMDY

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi DevCrmUser,

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans