web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / 2 get items to send em...
Power Automate
Unanswered

2 get items to send email with multiple data

(0) ShareShare
ReportReport
Posted on by 19

I`m looking to send a customized email with data pulled out from a SharePoint lists.

The main SharePoint list is used for the trigger when a new item is created"

Then i need to lookup names and email addresses from 2 other SharePoint lists using a unique identifier between each one of these lists  ( Child1 & Child2)and the main sharepoint list.

then to take all these data to the action " Send email V2" to send a customized email.

 

However, i managed to do so but with only one child list "one child list instead of 2"

 

PS: in the final " apply to each" : if i used values from the "Child2" or inserted any data pulled out from child2 in the email body, it get never sent.

 

Can you help me with this 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Since you are using two Get items I assume you are using two Loops to get the values out of the items.   If that's true then the values you read in one loop will not be available in the second loop directly.  You need to create variables and save the values in one of the loops into some other form, like a comma delimited string or array. Then you can use those variables in the second loop to populate your email.

  • oabd0250 Profile Picture
    19 on at

    here is the flow.

     

    it works only when i select "Value" from first "Get item".

     

    I`m not a heavy Flow user, so would you kindly explain a bit more to me how it can be done ?

     

    Thanks.
    Regards

    part1.JPGpart2.JPG

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    What values are you trying to get from each item and put in the email?  How do you want to format them.  The point is that you can only process one Get Items action in a loop at a time.  So you have to process one set of records and then the other.  So you have to either store the values you want to use in a second loop or put one loop inside the other.

  • oabd0250 Profile Picture
    19 on at

    look the major list contains unique identifiers that can be matched with the 2 child lists and the total sold products 

    child 1 : contain the name of the product " : using the 1st uniqie identifier code
    child 2 : Contain the Name of the Customer

    in the email i need to combine data from the 3 lists ( the main list and both the child lists )

    Dear CustomerName,

    We would like to thank you for purchasing ProductName from our store.
    Please note that you have paid : Total_Price 

    Customer Name & Email adress of the customer : found in list 1
    Product name & price : found in list 2

    Number of units and Total Paid : found ready in the main list.

     

    How would you advice?
    Thanks in Advance.

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Use 2 Get Items with Odata queries that limit the returned records from each list to the one you want.  Process each of those returns using a First() function to get the First record returned and store it in an object variable.  You now have two object variables that contain the values you want from each list.  Use properties of those objects in your email.

  • oabd0250 Profile Picture
    19 on at

    I have done as below in the attachments 
    Would you please tell me if i`m right or not ?

    In the send email part it always ask for value from Get1 or Get2 .. what would you suggest

     

    Thanks.

    part1 new.JPG

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    1) Not sure how you got the intitialize variable actions inside the loop.  Normally that will generate an error.  You have to initialize them outside the loop and set them inside the loop, assuming you are using a loop since I suggested you use First() instead.

    2) I don't understand what you mean when you say the send email asks for Get 1 and Get 2.  You've stored those values in the string variables so that you can use them in the body of the email.

  • oabd0250 Profile Picture
    19 on at

    Thank you for your patiance, 

     

    What i mean is that when i`m building the email template i can use only items from on of the lists but not both at the same time.

    What i want to do is to get A,B,C,X from list 1  & Get D,E,F from list 2

    and in the email action
    ---------------------------
    Send to : A
    Subject : E
    CC : C

    Dear X,
    please note that D has been submitted with the price F.

    -----------------------

    would appreciate your advice,

    thanks.

  • Verified answer
    Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    If you initialize the variables outside the loops and then set them inside the loops, then the values will be available when you send the emails after the loops have completed.  This should give you access to both sets of results.

  • oabd0250 Profile Picture
    19 on at

    here is what i got.

     

    the flow runs any way but the faded item here is not appearing in the email.

     

    Faded.JPG

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard