web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Can't use dynamic cont...
Power Automate
Answered

Can't use dynamic content in Apply to each after Filter array (in email and to update a row in Excel)

(0) ShareShare
ReportReport
Posted on by 55

Hello, 

Part 1:

I would like to use dynamic content in an email body after the content has gone through Filter array and then in Apply to each loop. I tired using item()?['Name'] but that fails when flow runs ... ('Name' is the name of Excel column I want the data from for the data running through Apply to each)

 

Flow overview:

Rows are filters based on conditions, then emails are selected and turned into a variable for each separate one. Excel rows are again filtered for each one(s) containing the separate email (variable), then grouped into an HTML table if multiple lines or same email.

FlowOverview.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

You can see the content is still available in Filter array 1 within the loop. 

FilterArray1 output.png

 

 

 

 

 

 

 

 

 

 

Then in the email body the "Current item" is the email address located in multiple rows from the Excel sheet

EmailBody.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Part 2:

This may be solved if I can get the dynamic content from Part 1, but after the loop send the email, I want it to update a row saying "Emailed date" (I used a utc formula to get date). Each row has a RowID column in Excel, so similar to the Name, it would correspond to the row from Excel which went through the loop. This would function kind of like a verification that the email was sent for that row. 

 

Update a Row.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I'd appreciate any help you can offer! Let me know if I can clarify anything. 🙂

Categories:
I have the same question (0)
  • Verified answer
    rzaneti Profile Picture
    4,476 Super User 2026 Season 1 on at

    Hi @am02 ,

     

    The error here is that you are using a property reference directly to "Filter array 1", like it was an object (last image shared by you): outputs('Filter_array_1')?['RowID']. Before accessing the property, you must access an array element.

     

    If I understood correctly, you are using the "Filter array 1" to isolate the record that matches to a specific email, and this filter operation is expected to always return a single record. If this is the case, you can solve the problem by adding this to the expression: outputs('Filter_array_1')[0]?['RowID']. The "0" is referencing the first element of the array generated by "Filter array 1", and as I'm assuming that you have a single record only, it must solve your problem.

     

    If your "Filter array 1" can return more than one record and you want to update all of them in Excel, then you will need an additional "Apply to each" action to loop "Filter array 1", and inside use the item()['RowID'] expression to populate the Excel action.

     

    I'm also sharing here some articles about the topics discussed in this answer for future reference from you or any other users that finds this thread in the future:

    - Data types in Power Automate: http://digitalmill.net/2023/08/03/data-types-in-power-automate/ 

    - Accessing array elements in Power Automate: http://digitalmill.net/2023/07/12/using-loops-and-accessing-array-elements-in-power-automate/ 

    - Working with Objects in Power Automate: http://digitalmill.net/2024/02/08/object-data-type-in-power-automate/ 

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/ 
    https://www.linkedin.com/in/raphael-haus-zaneti/ 

     

  • am02 Profile Picture
    55 on at

    Hey @rzaneti,

    Thanks for your reply!

     

    I was able to successfully run the flow and update the correct rows in Excel by adding another Apply to each referencing 'Filter array 1' and item()?['RowID']! 

     

    I tried using outputs('Filter_array_1')[0]?['Name'] in the email body to add the Name from that same line of Excel which the Filter array 1 is outputting, but it produced the below failure. If I removed the '0' it allowed the flow to run, but the Name was not inserted into the email. Any suggestion for this?

    Send an email error.png

     

  • Verified answer
    rzaneti Profile Picture
    4,476 Super User 2026 Season 1 on at

    Hi @am02 ,

     

    I'm happy to hear that the 'RowID' part worked!! For the 'Name', I ran a test here and there is an error in the expression that I provided: the "arrays" are usually inside the body element of "Filter array 1", so the correct expression for you case must be outputs('Filter_array_1')['body'][0]?['Name'].

     

    Let me know if it works! If not, please share the raw outputs from "Filter array 1", that you can find by clicking in the button below in your flow run details page:

    rzaneti_0-1708646937698.png

     

    If you have any trouble to access it, let me know or refer to this step by step: http://digitalmill.net/2023/06/29/how-to-access-the-raw-outputs-in-power-automate/ 

     

  • am02 Profile Picture
    55 on at

    Hi @rzaneti,

    outputs('Filter_array_1')['body'][0]?['Name'] was the correct expression and produced the desired output in the email body! Thanks so much for your help and knowledge!

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 376

#2
Valantis Profile Picture

Valantis 361

#3
David_MA Profile Picture

David_MA 294 Super User 2026 Season 1

Last 30 days Overall leaderboard