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
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
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']
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
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".
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
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'])
Thanks
Anna
Hi @timodondino I see what you want now.
1. initialize variable type with array
2.Get Items (i guess you don't need this part screen shot 😁)
3. make the frist apply to each
4. make the Second apply to each 2
my test list like
the reslut like
1.
2.
the full map like below
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
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:
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
Hi @timodondino
yes, you can use apply to each.
but you have to filter in loop.
if you need all code for mail/info1/info2
i have a test list like this
after run this flow the result like below
line 1
line 2
Full Map
I hope it helps.
BR
Ler
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional