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

Problems testing for empty result from Excel - List Rows present

I am trying to write a simple flow which looks to see if a row containing a key item exists, and if not I will add a new row.

 

I wrote an Odata filter in List Rows Present to search on the incoming key data. If the key value is not found, I get an empty body from List Rows Present. I have tried creating a Condition to test for Null in tons of ways:

equals(triggerbody(), null) = true

trigger() = null

triggerFormDataValue('value') = null

and *many* other variations. 

 

Any suggestions would be greatly appreciated!

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @Anonymous ,

 

If it is an array, you can also use length() to determine the number of array elements. The current Body returns an empty array, so we can use the method I provided directly.

10.PNG11.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support
Community Support

 

Hi @Anonymous ,

 

You could use length() function to get numbers of the filtered rows.

Expression reference:

length(body('List_rows_present_in_a_table')?['value'])

Image reference:

115.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you, this was very close! Because length() wanted a string, I used the following:

 

length(string(body('List_rows_present_in_a_table')?['value']))
 
And, since Body contained "value: []" the returned length was 2, presumably for the square brackets.
So, I modified the Condition to compare the above length string equal to 2 and it works!

 

Hi @Anonymous ,

 

If it is an array, you can also use length() to determine the number of array elements. The current Body returns an empty array, so we can use the method I provided directly.

10.PNG11.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (7,512)