cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
redhoezth7
Frequent Visitor

Sending an email with multiple lines in Sharepoint

Good day,

 

I am bit new in power automate. I am trying to send an email from a SharePoint list with get items.

 

I have the following situation. I have multiples lines with a purchase order in common.

 

Ex:

Purchase OrderPosting DateCost
4444131/12/2021$300
4561351/11/2021$513
4444131/12/2021$25
3415641/11/2021$1351

 

The idea is to group in the email the purchase orders and send the notification. Also, the posting date should be the same.:

Ex:

Purchase OrderPosting DateCost
4444131/12/2021$300
4444131/12/2021$25

 

1. How can I make the path within SharePoint to group the purchase orders?

2. How can I guarantee for the second iteration not to send again the email?

 

I hope someone can help me please! 

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

@redhoezth7 

I have simplified the flow as below:

Mira_Ghaly_0-1611788592053.png

Union Compose Data Operation: 

union(body('SelectPurchaseOrderNumbers'),body('SelectPurchaseOrderNumbers'))
 
 
 

 

Mira_Ghaly_6-1611789091449.png

 


 


PurchaseOrderPO Compose:Expression: items('Apply_to_each')?['Purchase']

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

View solution in original post

7 REPLIES 7
Mira_Ghaly
Dual Super User
Dual Super User

Hi @redhoezth7 

You can use the Order By Expression on your Get Items as below:

Mira_Ghaly_0-1611633578236.png

And then Use the Create HTML Table action to generate an HTML table and pass its Output to the email and hence avoiding sending email twice

Mira_Ghaly_1-1611633642805.png

 

Hope this Helps!

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here
redhoezth7
Frequent Visitor

Hi Mira, thank you for your response.

 

Just two questions.

 

1. What do you have in outcome when you filter the query?

2. If I have the SharePoint list with different purchase orders similar, it will send the email for each one? 

 

Ex:

Purchase OrderPosting DateCost
4444131/12/2021$300
4561351/11/2021$513
4444131/12/2021$25
3415641/11/2021$1351
3415641/11/2021$1360

 

It will send:

Email 1:

Purchase OrderPosting DateCost
4444131/12/2021$300
4444131/12/2021$25

 

Email 2: 

Email 1:

Purchase OrderPosting DateCost
3415641/11/2021$1351
3415641/11/2021$1360

 

Thank you! 

Mira_Ghaly
Dual Super User
Dual Super User

Hi @redhoezth7 

Please check the below article ; it describes  the same scenario you are after

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Get-Unique-Values-from-SharePoint-...

 

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here
redhoezth7
Frequent Visitor

Hi Mira,

 

Again, thank you for your response.

 

I have tried that solution, however, I am facing an issue with the filter array.

 

redhoezth7_0-1611713224327.png

 

I followed step by step the solution, but the filter is not working and is in blank.

 

Do you know what could it happened?

 

Thank you!

@redhoezth7 

Have you examined the flow history run as this might give you am idea what is going wrong?

If you can post full screens of your flow / flow history run .. I am happy to help!

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here
redhoezth7
Frequent Visitor

@Mira_Ghaly ,

 

Sure, I will share with you my flow run:

 

redhoezth7_0-1611715847721.png

 

 

In this step, I will remove duplicates.

redhoezth7_1-1611715871409.png

 

 

Then I will start apply to each for each PO:

redhoezth7_2-1611715914009.png

 

And here is the filter Array

redhoezth7_3-1611715933040.png

redhoezth7_4-1611715962986.png

 

Let me know if it is enough information.

 

 

@redhoezth7 

I have simplified the flow as below:

Mira_Ghaly_0-1611788592053.png

Union Compose Data Operation: 

union(body('SelectPurchaseOrderNumbers'),body('SelectPurchaseOrderNumbers'))
 
 
 

 

Mira_Ghaly_6-1611789091449.png

 


 


PurchaseOrderPO Compose:Expression: items('Apply_to_each')?['Purchase']

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,476)