Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Configure "Run After" Apply to each when only some of the apply to each fails

(0) ShareShare
ReportReport
Posted on by 163

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.

 

sobenson_0-1673280683058.png

 

  • Verified answer
    sobenson Profile Picture
    163 on at
    Re: Configure "Run After" Apply to each when only some of the apply to each fails

    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

    sobenson_0-1673880018544.png

    I had to add the compose "OutputArray", add the variable, then run the condition 

    empty(outputs('OutputArray')) is equal to true

     

  • bblake8480 Profile Picture
    642 Most Valuable Professional on at
    Re: Configure "Run After" Apply to each when only some of the apply to each fails

    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/ 

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow