cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Sending an email at the end of flow

I am creating a flow that has multiple switches and preceeding approvals, at the end of the flow, I would like an email to be sent that sends a link to the sharepoint list. Though I only want the email to be sent for the Yes responses. I do not want 7 separate emails sent. Here is my flow

 

Microsoft Flow.png

1 ACCEPTED SOLUTION

Accepted Solutions

@Anonymous:

 

Here is a simple example of how to accomplish you goal - there is more than 1 way to get there (I could have used an array).

 

I neglected to add a link to the list item but that can easily be added to the email.

 

 First, I declare a string variable before the switch statements

Swirch1.jpg 

Next, in each switch statement, if the request is approved, I append to the string variable - note that the string ends with a <br>

Swirch2.jpg  

Finally, I check to see if the variable has been populated.  If so, I reference it in an email.  The email must have "is HTML" set to yes.

 

Swirch3.jpg 

The email looks like this:

Swirch4.jpg 

Give it a try and let me know if this works for you.  

If so, please mark your post as Solved.

 

Scott

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

10 REPLIES 10
Super User III
Super User III

@Anonymous:

 

Since you are using a switch statement, only one approval should run.  Why not add an a condition and an email action immediately after each approval.  The condition checks to see of the item was approved.

 

If this addresses your issue, please mark your post as solved.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Anonymous
Not applicable

Actually, multiple switches can apply. There are 7 switches, any combination of switches can apply. each have their own approval flow. If I do as you suggested, I will get up to 7 separate email. 

@Anonymous:

 

In that case, initialize an array variable before the switch statements.  If an item is approved, then append to the array.  After the switch statements, evaluate the array and send an email as appropriate.  You could convert the array into an HTML table and insert the table into the email if you want.

 

You could use a compose action as well.

 

Scott

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Anonymous
Not applicable

Here is my powerapp and sharepoint list, if it helps to show the workflow 

PowerApps.pngList_Settings.jpg

Anonymous
Not applicable

Thank you for your response Scott! Do you happen to know a good resource to help me set this up? I'm strugging to understand arrays and how to apply it to my flow.

@Anonymous:

 

I'll update this post with an example later today or tomorrow.

 

Can you tell me if, for the purposes of your email, all you need to know is that a certain value is set to "yes" or is there additional info that should be there as well.  In other words, if "G Drive" is set to on, is that all you need in the email or is there other info that should be there as well that relates to the "G Drive".  Basically, I'm asking if there should be more than 1 column in the array/collection.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Anonymous
Not applicable

All I need to know for GDrive is that it is 'on'. Though, going back to the original idea, I need the email to bring together all switches that = 'on'. So the Array would be something like: (if i understand)

Gdrive Yes

Hdrive Yes

Idrive Yes 

Kdrive Yes 

and so on. 

If the answer is 'No' then it does nothing. 

 

 

Anonymous
Not applicable

I tried to do this, but its still not working. Here are my steps

 

1. When an item is created

2. compose- createarray

3. Initialize variable

4. switch

5. approval yes or no

6. if yes, append to an array

7. create html table

8. Filter array 

 

Here are some screenshots1_Microsoft Flow.png

2-flow.png3-flow.png

 

 

@Anonymous:

 

Here is a simple example of how to accomplish you goal - there is more than 1 way to get there (I could have used an array).

 

I neglected to add a link to the list item but that can easily be added to the email.

 

 First, I declare a string variable before the switch statements

Swirch1.jpg 

Next, in each switch statement, if the request is approved, I append to the string variable - note that the string ends with a <br>

Swirch2.jpg  

Finally, I check to see if the variable has been populated.  If so, I reference it in an email.  The email must have "is HTML" set to yes.

 

Swirch3.jpg 

The email looks like this:

Swirch4.jpg 

Give it a try and let me know if this works for you.  

If so, please mark your post as Solved.

 

Scott

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Anonymous
Not applicable

Scott- I cannot thank you enough! This works perfectly!

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (46,785)