cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

SharePoint list by Team and send an email to the members of that team on a weekly basis

Hi, I am pretty new to Flows, so I will try to describe what I am trying to accomplish as best as I can.. I have a sharePoint list with columns like this:

 

2020-05-11 13_31_39-Commercial Intensity Program - RAIL List - All Items.png

 

The important columns to take note are Team Name, and CF Group

Team Name - is a single line of text (Title/describes the team name)

CF Group - is a person column, it can take multiple selection (person 1, person 2, etc), and its people only (members of the team)

 

What I would like to do is group the SharePoint list that I have, by the Team Name, and send the list associated to the members of the team in one email on a weekly basis. I know how to set up the flow to run on a weekly basis, but everything after that is difficult..

 

So the email should look like this:

To: CF Group (their email addresses of the team)

Subject: TBD

Body:

Sharepoint list grouped filtered for the given team name

 

 

 

There doesn't seem to be an easy way to do this, unfortunately. I looked around on the forum, but can't find anything like this one. Please let me know if you can help, thank you. 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

Hi @imadorkous,

 

You could initialize a string variable action to hold these Emails in a CF Group. Then use the Append to string variable action to put the Email and character ";" into the variable, then you can put it into the Send Email action *To field; Then if you want to get the list group by the Team name, you could create the second Get items with Filter query, TeamName eq 'dynamic content', then create an HTML table as the Email body.

After that, you should set the variable to null to let the variable could hold these Emails of the next CF Group.

Annotation 2020-05-12 164907.jpg

 

Annotation 2020-05-12 164921.jpg

 

Annotation 2020-05-12 164948.jpg

 

Annotation 2020-05-12 165048.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @imadorkous,

 

Thanks for your reply, if the two fields' people numbers are dynamic, you could initialize two string variables to hold theirs displayname, and initialize an array variable to structure the final table named WholeEntity:

Annotation 2020-05-20 173836.jpg

 Then put the items into the Apply to each action, then put the array of Assign RAIL and Sales engineer into two individual apply to each actions to get their display name:

Annotation 2020-05-20 173906.jpg

 

Then add the Append to array variable action as below, put the two display name variable into the array member, after you should empty the two display name variable for next item:

Annotation 2020-05-20 174138.jpg

 

After all, create HTML table by using the WholeEntity variable:

Annotation 2020-05-20 174858.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Community Support
Community Support

Hi @imadorkous,

 

You could initialize a string variable action to hold these Emails in a CF Group. Then use the Append to string variable action to put the Email and character ";" into the variable, then you can put it into the Send Email action *To field; Then if you want to get the list group by the Team name, you could create the second Get items with Filter query, TeamName eq 'dynamic content', then create an HTML table as the Email body.

After that, you should set the variable to null to let the variable could hold these Emails of the next CF Group.

Annotation 2020-05-12 164907.jpg

 

Annotation 2020-05-12 164921.jpg

 

Annotation 2020-05-12 164948.jpg

 

Annotation 2020-05-12 165048.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you, @v-litu-msft,

This worked great! I'm almost at the end of the tunnel, but I am stuck getting some of the values for some fields:

2020-05-18 12_08_26-Power Apps.png

 

It is coming out like this:

2020-05-18 12_11_04-Sent Items - TAbraham@flowserve.com - Outlook.png2020-05-18 12_17_54-Sent Items - TAbraham@flowserve.com - Outlook.png

 

 

How can I get the values (display names) of the fields Assign RAIL Item to: and Sales Engineer to just show, and how do I only get the text on Action Items field to just show?

 

 

Hi @imadorkous,

 

Are the numbers of Assign RAIL and Sales Engineer always fixed? Always 2 and 1?

If they are fixed, it is simple to do, you could use the expression:

Assign RAIL field:

item()?['Assign_RAIL_Item_to'][0]['DisplayName'];item()?['Assign_RAIL_Item_to'][1]['DisplayName']

 Sales Engineer field:

item()?['Sales_Engineer'][0]['DisplayName']

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

no, it would be dynamic; It can be one, two or sometimes even three names in either of the fields. Let me know if there is something else I could do.

 

Do you know if there is anything that can be done on the Action Items field?

Hi @imadorkous,

 

Thanks for your reply, if the two fields' people numbers are dynamic, you could initialize two string variables to hold theirs displayname, and initialize an array variable to structure the final table named WholeEntity:

Annotation 2020-05-20 173836.jpg

 Then put the items into the Apply to each action, then put the array of Assign RAIL and Sales engineer into two individual apply to each actions to get their display name:

Annotation 2020-05-20 173906.jpg

 

Then add the Append to array variable action as below, put the two display name variable into the array member, after you should empty the two display name variable for next item:

Annotation 2020-05-20 174138.jpg

 

After all, create HTML table by using the WholeEntity variable:

Annotation 2020-05-20 174858.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-litu-msft ,

This worked out great, the last piece that I am trying to figure out is how to get just the text out of the action items field (multi-line field). This is what it currently looks like right now:

2020-05-18 12_17_54-Sent Items - TAbraham@flowserve.com - Outlook.png

There are two records, and the first record should say "Update is provided!", and the second record should say "Testing testing"

 

Hi @imadorkous,

 

Using the Html to text action could do it, please have a try:Annotation 2020-05-22 162821.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

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!

Top Solution Authors
Top Kudoed Authors
Users online (7,966)