cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GarryPope
Impactful Individual
Impactful Individual

Check if value is not null using Common Data Service (Current Environment) connector

Hello Power Automate Community,

I have a question please.

I am using the Common Data Service (Current Environment) connector.

I have an entity called "Budget Item". It has a many-to-one relationship with the "Contact" entity, so on the "Budget Item" record is a lookup field called "Contact" where a user can link a Budget Item to a Contact. This field is not required, which means sometimes the field is populated and sometimes it's blank. All good so far.

 

When my flow runs it creates a copy of the Budget Item record and populates all the same fields as the original Budget Item.

In my action "Create a new record" if the Budget Item I was copying didn't contain a value in the Contact lookup field it failed, this is because I was trying to set a value. 

To get around this I added a "Condition" action that looked to see if the field "Contact" is not equal to null.

So if the Contact field is populated the condition sends the flow down the "Yes" branch and creates a Budget Item with the Contact field populated.

If the Contact field is not populated, meaning null, it goes down the "No" branch and creates a Budget Item with the field not populated.

 

This is doing exactly what I want, but it doesn't feel so optimal. What I would like is to not have the Condition action at all, but use an expression in the Contact lookup field. So it would work like this.

If Contact field = Null, use Null. If Contact field is populated use the value. 

 

Does anyone have any ideas how to write this expression please, I attempted it, but with the Common Data Service (Current Environment) connector it is very picky with lookup fields.

Thanks very much and sorry for such a long post. 

Garry

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ManishJain
Solution Sage
Solution Sage

Hi @GarryPope ,

 

At this time it is not possible to pass null value to a look up field , so what you are doing is ideal way. 

Please have a look at following url :

 

http://linnzawwin.blogspot.com/2019/11/power-automate-how-to-set-lookup-field.html

 

Thanks

View solution in original post

1 REPLY 1
ManishJain
Solution Sage
Solution Sage

Hi @GarryPope ,

 

At this time it is not possible to pass null value to a look up field , so what you are doing is ideal way. 

Please have a look at following url :

 

http://linnzawwin.blogspot.com/2019/11/power-automate-how-to-set-lookup-field.html

 

Thanks

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (46,943)