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 / Append to array for em...
Power Automate
Answered

Append to array for emailed table causing duplicate rows

(0) ShareShare
ReportReport
Posted on by

Hi all, 

 

My goal is to send a recurring email to mgmt with a table that pulls from a SharePoint list. I have it mostly set up and the email works and the table comes together... but certain list columns allow for the user to select multiple options from a dropdown list. Because there are multiple selections a user can choose, the table generates a row for each selection instead of combining them into one row. 


Here's the flow (sensitive info blocked):

kas634_0-1610733084001.png

Then here's my append to array:

kas634_1-1610733151572.png

The "apply to each 3" for the Category input is automatically added by the flow, and I cannot remove it. I think this is causing the problem. 

 

Here's the end:

 

kas634_2-1610733251094.png

 

Here's an example of what the email produces:

kas634_3-1610733605045.png

Here's what I'm hoping to get out of it:

kas634_4-1610735434205.png

I've tried a few trial and error tests, like doing an initialize variable/append to variable (string and array) for the category field and then adding that variable to the array table.. but those don't seem to work. 

 

Also, if someone could help me translate the Created Date field into a Month/Day/Year format, that would be appreciated as well..

 

Thanks!

 

 



Categories:
I have the same question (0)
  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @kas634 

    As your category column is multi choice type then inside your Apply to each first append all choices in a variable and then use append to array variable. it will solve your problem.

     

    For Date format- use expression formatDateTime(Your created date,'MM/dd/yyyy')

     

    Thanks

    Hardesh

  • kas634 Profile Picture
    on at

    Hi Hardesh, 

     

    Thanks for responding. I tried your solution (pictured below is how I interpreted your instructions) and I'm still getting the same output from the original email. Can you help advise further?

     

    kas634_0-1611070816276.png

     

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @kas634  pls take append to array variable action outside of apply to each 3 loop and then try.

    Thanks

    Hardesh

     

  • kas634 Profile Picture
    on at

    Hey Hardesh, 

     

    It looks like we're getting somewhere, the duplicate rows have been removed now. However, now the Category Column is showing the categories of that row plus any previous rows. For example, "Example 2" in my snapshot table is showing "Category 1, Category 2, Category 3" instead of just "Category 2, Category 3".

    cap1.PNG

  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @kas634  please set you category variable as null after append to array variable 2. This will reset your variable and will have value only for current loop item.

    Thanks

    Hardesh

     

  • kas634 Profile Picture
    on at

    This worked, thank you 🙂

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard