cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
McMonty
Level: Powered On

Create a daily sales summary for each user

Hi,

I'm trying to find an example of how to send a daily email to users from a SharePoint list.

Basically, each salesperson will get an email listing their records.

 

Capture.PNG

 

I'm thinking something like this:

Get unique list of salesperson from the list

Loop through each salesperson

create a list of items for that salesperson

create a html table an populate it with those items

create email and add the table to the email

 

The question is how/if that can be done in Flow?

Any input would be much appreciated :-)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Create a daily sales summary for each user

Hi @McMonty ,

 

Please try to refer to the following method to configure Flow.

  • Initialize two array variables, one type is used to store Salesperson email, another one is used to store HTML table content.
  • Configure Apply to each to get all Salesperson email and append then to array variable.
  • Use union() function to remove the duplicate element and generate new array.
  • Iterate value of Get items action and use condition to filter current Salesperson’s item, append field which needs to be displayed in HTML table to array variable.
  • After sending an email, we need to empty the array variable.

Expression reference:

 

union(variables('Salesperson email'),variables('Salesperson email'))

Image reference:

 

8.PNG9.PNG10.PNG

 

Best Regards,

Community Support Team _ Barry
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

3 REPLIES 3
Super User
Super User

Re: Create a daily sales summary for each user

Hi @McMonty 

 

Can you share more detail on this? 

 

Where is the sales data of the sales persons? If it is on CDS or a dynamic excel sheet etc. you might not have to create the items again in the SP list (the sales details) and you can directly call the data from the references (excel or cds etc.) and populate an array and then create an HTML table from it. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
McMonty
Level: Powered On

Re: Create a daily sales summary for each user

Hi,
The data is in a SharePoint List containing these columns:

Capture.PNG

 

The images below shows what I'm done so far. I'm now stuck on being able to create a table that contains the Salesperson email, Order Name and Amount that I can add to an email.


Pic1.PNG

 

#1.PNG

Union Array expression: 

union(variables('Unique_Names'), createArray(item()?['SalesPersonEmail']))
 
#2.PNG
 
Pic3.PNG
 
 
 

 

Community Support Team
Community Support Team

Re: Create a daily sales summary for each user

Hi @McMonty ,

 

Please try to refer to the following method to configure Flow.

  • Initialize two array variables, one type is used to store Salesperson email, another one is used to store HTML table content.
  • Configure Apply to each to get all Salesperson email and append then to array variable.
  • Use union() function to remove the duplicate element and generate new array.
  • Iterate value of Get items action and use condition to filter current Salesperson’s item, append field which needs to be displayed in HTML table to array variable.
  • After sending an email, we need to empty the array variable.

Expression reference:

 

union(variables('Salesperson email'),variables('Salesperson email'))

Image reference:

 

8.PNG9.PNG10.PNG

 

Best Regards,

Community Support Team _ Barry
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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 449 members 4,399 guests
Please welcome our newest community members: