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 / String Variable in Flo...
Power Automate
Unanswered

String Variable in Flow Causing Multiple Emails To Send Under "Apply to Each"

(0) ShareShare
ReportReport
Posted on by

This flow runs after a separate flow I have - the first flow adds an item to a sharepoint list whenever a new forms response is submitted. Then, when a new item is created, the below flow is what I have. 

 

The purpose of "get file content", followed by 'Compose' and 'Initialize Variable' to add an email signature as a photo to "send email"The purpose of "get file content", followed by 'Compose' and 'Initialize Variable' to add an email signature as a photo to "send email"

In compose, I selected the URI expression and added in the 'signature' photo. Followed by 'initialize variable' to convert to a string. The formula used here is: "concat(' <img src = "',outputs('Compose'),'" alt = "" />')"In compose, I selected the URI expression and added in the 'signature' photo. Followed by 'initialize variable' to convert to a string. The formula used here is: "concat(' <img src = "',outputs('Compose'),'" alt = "" />')"

After that, I 'get items' from the form response and added the control "apply to each" in order to send an email to the responder each time a new SharePoint item is created from a forms response. The problem here is this step sends out three emails as opposed to one. After running the flow, there are 3 emails that get sent out for each SharePoint item. See below:

Why are there three emails to be sent in this step? How come I can only see this after running the flow?Why are there three emails to be sent in this step? How come I can only see this after running the flow?

 

This step is then followed by 'initialize variable' and 'compose' with a condition to check whether an email was successfully sent. If true, terminate and stop sending emails. 

Capture4.JPG

Capture5.JPG

Can someone help me understand why its sending three emails each time and how to fix this issue?

Categories:
I have the same question (0)
  • Andrew_J Profile Picture
    1,962 Moderator on at

    @KATHYTA 

     

    maybe it is becayse you GET ITEMS instead of GET ITEM. if you use the latter the apply to each would not be added.

     

    Andrew

  • KATHYTA Profile Picture
    on at

    Thanks for the quick reply, Andrew! I modified the flow to "get item" as opposed to "get items" and entered the output as ID. However, I am getting this error message. Capture7.JPGCapture6.JPG

  • Andrew_J Profile Picture
    1,962 Moderator on at

    @KATHYTA 

     

    No problem I am sorry I could not resolve in the first instance.  My main concern is there a mixture of GET ITEM and GET ITEMS, when the flow starts off it GETS ITEM and then there are GET ITEMS.  And without seeing a lot more detail it is hard to understand the ITEM and ITEMS issue.  I think this is causing the issue of the three emails.  But the first GET ITEM in your post is the start of your flow then that it is not a trigger. It would need MODIFIED or CREATED to be the trigger based on the action of the other flow that is taking the data from the form submission.  But your flow runs as shown by the green ticks.

     

    Can you shed some light on the start?

     

    Andrew

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