Hi all,
I have a flow setup get details from a submitted form, email these details out and add these details to a spreadsheet. It is all working with no issue, except that it is sending the email to all of the recipients twice!
It is my first flow using Get User Profile connector so I can only assume it is something to do with this.
In the send an email step of my flow, I have added the email address from the Get User Profile step in as a CC. When I do this it automatically puts the Send an Email into an apply to each. I reckon this is causing it to duplicate the emails, but I have no idea why!
My flow is set up to get the response details, get the user details using the name from one of the answers within the form then check if there is an attachment against the form.
After this condition, it gets the attachment from the form and then moves to the email stage depending on some variables within the form response.
My email step looks as below:
I have checked the outputs of a flow run and it shows 1of2 in the email stage so it is clearly being duplicated, but the email details are identical
Any help to understand this will be very welcome! 🙂
Thanks again. I fixed this by using a combination of search for users and get user details in the end. All works fine now.
Your issue is still strange with using the 'Search for Users (V2)' and sending 2 emails to the same address. Because if your 'Search for Users (V2)' is only finding a single person, the Apply to Each would still exist, but it should only run once. So Apply to Each isn't a bad thing.
Can you go look in the outputs of the 'Get PM User Details' of a previous test/run and see if there are multiple "Email" fields in there? Even if they are duplicate, I would just look to see what caused PA see as 2 separate items and run the Apply to Each twice.
If you want to try and avoid the Apply to Each then you can use the Select action to map ALL the responses and then use a compose that gets the First item of your select action. So this is assuming that the results of the Search for Users is actually getting a single item or at least the first returned item is the correct person.
Select Map Email and Compose First(Select Output)
thanks for this.
My step is actually a search users step having looked deeper into it. The issue I have with using the Get user profile (V2) is that I dont seem to be able to get an email from the name using that connector, only a profile using an email
Is your step "Get PM User Details" really a "Search for users (V2)" step? Because that would cause PA to automatically put an apply to each on the value because a Search for users can return multiple profiles.
Are you able to use the "Get user profile (V2)" action instead which would be a single response and not require an Apply to Each.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2