HI, I have a flow that is updating a rows in a table. If the row has the data I need it updates, if not I append an array variable, and send an email to show what rows were not updated. I only want to send an email when that variable has data in it. I tried configuring the run after to only run on errors, but because the apply to each was successful, it never ran. If I set it to run after success I get blank emails. In my example below, how to I get the steps after the "Apply to each" container to only run if the variable has data in it? I tried a condition, variable is equal to null, but that did not work.
Thank you @barret that did lead me to the solution that I needed. https://www.powertechtips.com/check-if-array-is-empty-power-automate/ I the only reason I am not marking your response as the solution is I needed to add a compose field to my flow to make it work. Trying to check if the array was empty with the code of
empty(variables('varMissingEmpID'))
would give me a template error and my flow would not save.
The article was creating an array, not using a variable to collect the data.
Here is what I did
I had to add the compose "OutputArray", add the variable, then run the condition
empty(outputs('OutputArray')) is equal to true
An empty array is not equal to null. Check the following blog post on some good ways to check if an array is empty for your condition.
https://www.powertechtips.com/check-if-array-is-empty-power-automate/