Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Apply to each Person

(0) ShareShare
ReportReport
Posted on by 32

Hi,

 

I have a list on the sharepoint and in this list (or this table) there are different topics in every row and there is a column with a responsible person (better to say with the e-mail address of the responsible person). Now I want to create a flow which sends an e-mail to every single responsible person which includes only the topics he/she is responsible for.

I know how to create a HTML table with many topics and how to put this in just one mail. My problem is how to say in MS Power Automate something like: "Create a HTML table for each responsible person". My idea was to work with "apply to each" but I can't select the coloumn name in apply to each.
Is there a way to work with dynamic content and create a html table for each e-mail address and send this html table to that e-mail address?

Thanks!
Timo

  • timodondino Profile Picture
    32 on at
    Re: Apply to each Person

    Hey @Ler,

     

    what do I have to change in this flow if I want to add a condition? Something like, just put rows into each table if the Info2 = yes. To me it seems like nothing changes, doesn't matter if I add the condition at the beginning or at the end.

     

    Thanks and best regards,

    Timo

  • Ler Profile Picture
    72 on at
    Re: Apply to each Person

    Hi @timodondino 

     

    the mail/info1/info2 is the column of the list. that is a example.  you can change to your column you want.

    I was also very confused at the beginning 😁

    in this case not in dynamic content, you have to write that to expression. and it is also easy.

    if the column is "mail" then write item()?['mail']

    if the column is "good" then write item()?['good']

    2021-02-05 08_52_01-Window.png

    by the way you don't need care of the icons of "mail" "info1" "info2" . it will be change icons after you run the flow. i am also confused why it is changed. because after the icons changed you can't modify the content in expression. I have to del that and write again...

     

    I hope it helps

     

    BR

    Ler

  • timodondino Profile Picture
    32 on at
    Re: Apply to each Person

    Hey @Ler ,

     

    that is awesome! Thank you very much! The whole flow works and I can see the results I want to see after testing the flow. There is just one (important) issue. Of course I want to customize the HTML table like you did it. But I don't get any suggestions for dynamic content with the purple filter symbol. This is what I can add in the value column where you put in "mail" "info1" "info2".

    timodondino_0-1612428590389.png

    I guess I don't understand your comment in the screenshot "mail = item()?['mail']".


    I hope you can help me again with my last question but thanks again for that huge solution! 🙂


    Best regards,

    Timo

     

  • v-duann-msft Profile Picture
    on at
    Re: Apply to each Person

    Hi @timodondino 

     

    If you got duplicate results for one same record. It must be caused by incorrect expression in filter array area.

     

    You should use ‘mail in apply_to_each’ equal to ‘mail in get_items’, but there is no dynamic content under get items, thus, we need to input expression as below:

     

    @equals(items('Apply_to_each')?['ResponsePerson'], item()?['ResponsePerson'])

    v-duann-msft_0-1612237151191.png

     

    Thanks

    Anna

  • Verified answer
    Ler Profile Picture
    72 on at
    Re: Apply to each Person

    Hi @timodondino  I see what you want now.

     

    1. initialize variable type with array

    2021-02-02 11_07_35-编辑你的流 _ Power Automate 和另外 10 个页面 - 工作 - Microsoft​ Edge.png

    2.Get Items (i guess you don't need this part screen shot 😁)

    3. make the frist apply to each

    2021-02-02 11_12_12-Clipboard.png

    4. make the Second apply to each 2

    2021-02-02 11_19_34-Clipboard.png

    my test list like

    2021-02-02 11_28_36-Grp_1CN1_GBO-SUNS - test_list - 所有项目 和另外 10 个页面 - 工作 - Microsoft​ Edge.png

    the reslut like

    1.

    2021-02-02 11_29_41-运行历史记录 _Power Automate 和另外 10 个页面 - 工作 - Microsoft​ Edge.png

    2.

    2021-02-02 11_30_29-运行历史记录 _Power Automate 和另外 10 个页面 - 工作 - Microsoft​ Edge.png

    the full map like below

    fullmap2.png

     

    my idea is we have a list with mail like "test1@test.com;test2@test.com;test1@test.com"

    we want to have a list like "test1@test.com;test2@test.com"

    so we just do the de-duplication before we filter

    after that we can make the filter test1@test.com one time for all test1@test.com

     

    I hope it helps.

     

    BR

    Ler

     

     

  • timodondino Profile Picture
    32 on at
    Re: Apply to each Person

    Hey Ler,

     

    thank you very much for that large answer! The filter array seems like it could be the operator I need. But unfortunately the result in the HTML table looks not like I want it in my case. I build my flow like you did and it works but in my sharepoint list every e-mail address shows up more than one time. So for example if my e-mail address shows up 3 times, I want to get just one mail with one HTML table and three different topics in that table. But with this flow I get 3 mails and in every single mail there is one HTML table with just one topic but three times. So one of the tables looks like that:

    timodondino_0-1612170436146.png

     

    I tried to put the filter array in front of apply to each but nothing changed.

     

    Do you have any idea? To me it seems like Power Automate doesn't understand if there is the same e-mail address in that column of the list.


    Thanks and best regards!,

    Timo

     

  • Ler Profile Picture
    72 on at
    Re: Apply to each Person

    Hi @timodondino 

     

    yes, you can use apply to each.

    but you have to filter in loop.

    2021-01-29 11_56_41-Window.png

    if you need all code for mail/info1/info2

    2021-01-29 12_06_46-Window.png

     

    i have a test list like this

    2021-01-29 12_00_11-Window.png

    after run this flow the result like below

    line 1

    2021-01-29 12_01_45-Window.png

    line 2

    2021-01-29 12_02_28-Window.png

     

    Full Map

    fullmap.png

     

    I hope it helps.

     

    BR

    Ler

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow