Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Logic App condition to check empty array

I am working on a Azure Logic App that returns an empty array after using Filter function. In the next step, I would like to use a condition that can check if the previous array is empty or not. If the output is empty, Then it will return true and I will do something. So, what is the correct way to write the condition to check if the array is empty ?

Logic app designer view

Filter Array Step in advance mode: @startsWith(item()?['LastModified'], utcNow('yyyy-MM-dd'))

And it returns: []

How to write condition in the next step to check if the body or return value is equal to []. Specially I am not being able to catch this empty array :(

Any help will be highly appreciated, thanks :)

like image 276
user9513505 Avatar asked Oct 15 '25 14:10

user9513505


1 Answers

You can refer to my Azure logic app:

enter image description here

We need to use the length expression:

length(body('Filter_array'))

The result seems to be no problem:

enter image description here

like image 122
Frank Gong Avatar answered Oct 17 '25 04:10

Frank Gong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!