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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow send single mail ...
Power Automate
Answered

Flow send single mail with multiple SharePoint items

(1) ShareShare
ReportReport
Posted on by

Hello Community,

 

I have a PowerApps application in place that is being used to submit items in a SharePoint list. After lines are submitted, I have a working flow that send email to someone with created items:

FilipC2_1-1662099260249.png

Inside the Switch action there is only the Send an email v2 action for different 'Status' column value.

 

My issue is that through the PowerApps application multiple lines can be submitted at a time and in this case multiple emails are send. 

What can be done so that all items submitted through the application in SharePoint list will be send in a single email ?

 

To be mentioned that I would like not to use 'Create HTML table' since the email itself was created in HTML format and it is pretty complex.

 

Thank you in advance for your time and support !

 

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

    HI @FilipC2 ,

     

    have you thought about changing your trigger to a scheduled one ?

    Maybe an hourly trigger or daily, is this fitting to your business use-case ?

    You can use in SharePoint a column to track if you have already sent a mail for this item. 

    In that case you can work with Get items action.

     

    What you can also think about is a new button which triggers the "send mail" process, so you have one for submitting items and one which is sending the mail. In that case you can send one mail for all items the user created with the PowerApp. Here you should also work with the extra column to track if a mail was sent by the user. 

     

  • FilipC2 Profile Picture
    on at

    Hi @GeorgiosG , thank you for your fast reply !

     

    I think SharePoint column for tracking if mail was sent will fit for my case the best.

    Could you please give me a hint / example of how could i do this ?

  • GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    I would create a new column with Type Yes/No:

    GeorgiosG_0-1662105764615.png

     

    In your flow you can use the action Get items and use an oData Filter: 

    MailSent eq false

     

    GeorgiosG_1-1662105993494.png

     

    And If you send the mail do not forget to use the action Update item and set the flag to Yes (true) 😉 

     

  • FilipC2 Profile Picture
    on at

    @GeorgiosG I do not really know if I did something wrong, but it is not working, even worst, now I'm receiving 4 mails for 2 submitted item.

    FilipC2_0-1662111620417.png

     

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @FilipC2 When using the trigger "When an item is created or modified" your workflow will start for every single item that was submitted to the list. Therefore this trigger will not fit for your usecase.

     

    Consider doing the following (as @GeorgiosG already suggested)

     

    1. Change your flow trigger to a scheduled trigger (runs every 10 min or so)

    2. Add a Column "MailSent" of Type "Yes/No" Default "No"

    3. Use Get Items with a oData Filter MailSend eq false

     

    Within your flow you have to iterate thru all items (value) of the Get Items action. Do whtever needs to be done....and Update the current item. This has to be done within the "Apply to each".

     

    After you have iterate thru all item you can continue with your switch action and send the mail with the content which has been put together within the Apply to each.

     

     

  • Verified answer
    GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    HI @FilipC2 ,

     

    with the compose action inside of the loop I wanted to demonstrate an example action.

    Inside of this loop you should, use the append action, like you did at the beginning and store the items in this arrays. 

     

    But to be honest I would go for an extra Button in your PowerApp which triggers a second Flow for sending a mail. I would recommend of creating a new column (single line of text) in your SharePoint list --> curID. In that column you can store a unique identifier. That means that all items within your session will have the same ID and you can send a mail with all items. You can generate an id every time a user opens up a screen in PowerApp or via a button. For the "To" field in PoweAutomate select Ask in PowerApp same for curID.

     

     

    In PowerApp you have to go to your main screen and select the onVisible property and say:

    GeorgiosG_0-1662124214236.png

    or use a button to generate a new session ID 

    GeorgiosG_2-1662124392643.png

     

     

    Unlock the curID field and say as default:

    GeorgiosG_1-1662124258128.png

     

     

    Now you can create a new Button which sends a mail via a PowerAutomate Flow:

    GeorgiosG_3-1662124441428.png

     

     

    Flow:

    GeorgiosG_4-1662124498227.png

    GeorgiosG_5-1662124527641.png

     

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard