cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to check if value is null with new condition parameters

Before Flow was updated to allow multiple condition parameters, I could put something like the following inside a condition:

@(not(empty(items('Apply_to_each')?['PHONE'])))

How do I do this in the current paradigm?

Phone is not empty.Phone is not empty.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable


@RobElliott wrote:

In the condition try adding an expression of PHONE is not equal to null. For the right hand box, click in it and go over to the right, select the Expression tab and type null and then select it to put it in the box.

Rob
Los Gallardos


Thanks for your input, Rob.  I should have given a bit more context.  My data source is a group of Visual Foxpro .dbf tables which I'm accessing through a SQL linked server.  In the data, these string values return from the SQL connector as empty strings rather than null.

 

Edit:  I've figured out how to do what I originally intended.  Using length is effective, but to me empty() is a bit cleaner and should also cover an unforseen null condition.  

empty(items('ForEachRow')?['CELLPHONE'])

Empty = false.png

I've decided to handle this by checking if the length of the string is greater than zero. That is working well, but I miss the advanced mode under the conditions.

length(items('ForEachRow')?['PHONE'])

If Phone Exists.png

 

 

View solution in original post

9 REPLIES 9
RobElliott
Super User
Super User

In the condition try adding an expression of PHONE is not equal to null. For the right hand box, click in it and go over to the right, select the Expression tab and type null and then select it to put it in the box.

Rob
Los Gallardos

Anonymous
Not applicable


@RobElliott wrote:

In the condition try adding an expression of PHONE is not equal to null. For the right hand box, click in it and go over to the right, select the Expression tab and type null and then select it to put it in the box.

Rob
Los Gallardos


Thanks for your input, Rob.  I should have given a bit more context.  My data source is a group of Visual Foxpro .dbf tables which I'm accessing through a SQL linked server.  In the data, these string values return from the SQL connector as empty strings rather than null.

 

Edit:  I've figured out how to do what I originally intended.  Using length is effective, but to me empty() is a bit cleaner and should also cover an unforseen null condition.  

empty(items('ForEachRow')?['CELLPHONE'])

Empty = false.png

I've decided to handle this by checking if the length of the string is greater than zero. That is working well, but I miss the advanced mode under the conditions.

length(items('ForEachRow')?['PHONE'])

If Phone Exists.png

 

 

Anonymous
Not applicable

Rob, I'm currently trying to resolve a similar issue.  I have condition that is checking if a variable is not NULL.  For some reason it keeps taking the "not null" track even though it's null.  I even set up a test flow that simply sets a variable to NULL, then uses a condition to check.  It keeps choosing 'not null'.  If you have any more advice I would appreciate it.  Thanks

Any idea of how to write expressions? Like a reference guide... I want to use the correct syntax and structure it right, but unsure of how to actually do it. 

@shavora 

Here is a link to the expressions reference

A quick search on YouTube will uncover a bunch of videos on getting started with expressions.

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Thanks @ScottShearer I am trying to use the reference guide. I am trying to use the concat function in realtime workflow and every time I structure it like in the reference guide, all I am getting is the actual code as a string instead of the field data I want to fetch. 

These are examples of what I have tried in the standard value slot, I don't find another place to write the concat function in. 

Skärmavbild 2021-10-25 kl. 10.07.21.pngSkärmavbild 2021-10-25 kl. 10.25.41.png

As per this post (https://powerusers.microsoft.com/t5/Microsoft-Dataverse/Auto-populate-the-Primary-Name-column-with-t...), it is supposed to work to use concat in the realtime workflows.

Its working using is not equal to null

Raviteja1992_0-1635918859657.png

 

Excellent.  Thanks Rob.

DeadFishEddie
Frequent Visitor

thank you

 

empty worked for me.

 

DeadFishEddie_0-1643209829577.png

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (2,054)