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 / Handling null values i...
Power Automate
Unanswered

Handling null values in conditional trigger

(0) ShareShare
ReportReport
Posted on by 716

Hello Power Automate Community,

I hope you can help please.

 

I'm using the "Common Data Service (Current Environment)" connector. I want the Flow to run when:

An "Opportunity" is marked as "Close Won"

And

The "Opportunity" field "Originating Lead" is populated.

 

I'm doing this using  a"Conditional Trigger" and it's working great, so long as a value is populated in the "Opportunity" field "Originating Lead". See below:

Trigger condition.png

 

 

But if that's not populated I get a failed message.

 

The next step in the Flow after the trigger is to get the Originating Lead GUID. So I used the "Get Record" action. But I receive the below error because the Opportunity didn't have a value in it's Originating Lead field.

 

Error on Lead action.png

I read somewhere that I should use the "coalesce", and I read information about that at this URL https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-isblank-isempty but I just can't write the expression needed to substitute the below expression using coalesce. 

@not(equals(triggerBody()?['originatingleadid_value'],'null'))

 

Any ideas on how to do that please? I believe the problem is the 'null' value, as that's a string and it's looking for an integer.

 

Thanks in advance to anyone that can help, I've wasted many hours trying to solve this. 

 

Garry

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hello @GarryPope 

     

    You could do it as a filter array then use the below within advanced:

     

    @or(equals(triggerBody()?['statecode'],1),not(empty(triggerBody()?['originateleadid_value']))

     

    Hope this helps.

     

    Thanks


    Bradley

  • CU01081947-0 Profile Picture
    716 on at

    Hello @Anonymous,

    Thanks so much for the feedback, I really appreciate it. 

    Just so I'm clear, the expression you gave me is for the Trigger Condition right?

    If so, I removed the two expressions I had in there and used your expression. Unfortunately I'm getting an error, sorry. See below:

    Flow error.png

     

    I actually think my original request is not possible. In Dynamics when I create an Opportunity and don't add a value in the Originating Lead field, when I look at the Trigger output that field is not in there, which, I believe, is to be expected. To solve this, after the trigger I'm just going to add a "Condition" to then check if a value is in the "Originating Lead" field or not.

     

    I did this before, but was trying to be clever and reduce my flow from running when not needed.

     

    Thanks anyway for your help,

     

    Garry

  • Community Power Platform Member Profile Picture
    on at

    Hello @GarryPope 

     

    Apologies, I misread you initial issue - I was suggesting that you used a filter array with my expression.


    This would have allowed you to narrow down the output to only the required values.

     

    Thanks

     

    Bradley

  • CU01081947-0 Profile Picture
    716 on at

    Hello @Anonymous,

    No problem at all. It was probably the way I wrote it! I appreciate your help. The Condition I added after the trigger is working a treat. 

    Thanks very much,

    Garry

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