cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stevenls
Helper IV
Helper IV

Ending a flow if an array is empty

Hi there,

I have some flows that run but sometimes the array is empty and the flow fails.  The array being empty is correct but what I want to do is gracefully end the flow so it doesn't fail and then end up being suspended.

After the Filter Array I have a condition that is 

empty(body('Filter_Array')) is equal to false

then if yes it continues on with the flow.  I am not sure what to put in No, as I put nothing there but the flow still has a fail as the run result.

 

Not sure what to do with the if no when the filter_array empty = true.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
NuttyPistons
Responsive Resident
Responsive Resident

Hi @stevenls ,

There is a flow step called "Terminate" that you can use when filter_array empty = true.

NuttyPistons_0-1637618544630.png

 



You can change the Status to "Succeeded" so that those don't show up as failed runs.

View solution in original post

5 REPLIES 5
NuttyPistons
Responsive Resident
Responsive Resident

Hi @stevenls ,

There is a flow step called "Terminate" that you can use when filter_array empty = true.

NuttyPistons_0-1637618544630.png

 



You can change the Status to "Succeeded" so that those don't show up as failed runs.

stevenls
Helper IV
Helper IV

oh awesome, I'll put that in place now and test it today.  I will loop back later on with an outcome.

 

Thanks for the prompt reply.

stevenls
Helper IV
Helper IV

That worked a treat.  Do you know if there is a way to refer to the name of the flow that this happens in.

As I said there are a couple of flows that are going to fail so I am just going to trigger an email to myself to say "Flow <Name> failed go double check the status" just to be really sure.  

I know I could type the flow name into the email but just wondering if there is a way to pull in the flow name dynamically

 

NuttyPistons
Responsive Resident
Responsive Resident

I do not believe there is a way to reference the flow name dynamically, unfortunately. I think you will just have to manually add that name into your email step.

stevenls
Helper IV
Helper IV

ok thanks for your help with this one.  At least now the flows that fail wont get suspended as they have actually succeeded.  WIN 😄

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,528)