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 / Using 2 Sharepoint Lis...
Power Automate
Answered

Using 2 Sharepoint Lists Get Items in an email

(1) ShareShare
ReportReport
Posted on by 238

Hi,
I have created a flow to send an email when a new item is entered into SharePoint list 1.
There are 3 possible emails to be send depending on a condition (value or 5, 10 or 15). The 3rd email (count of 15) also has an approval.
They are all working fine.

I am wanting to get items from a second Sharepoint list by using a filter based on a value in the triggered item.

Newbie2019_0-1720833614269.pngNewbie2019_1-1720833631089.pngNewbie2019_2-1720833650807.png

I added the initialise variable 1 to get the value as a string and it works:

Newbie2019_4-1720833976059.png

 

Newbie2019_3-1720833759535.png

In this case the value is s349987

I also added a second Get Items 1 which filters the second sharepoint list column field_18 if its equal to the initialize variable

Newbie2019_5-1720834044958.png


I am

When i approve the condition15, it then doesnt send the email:

Newbie2019_6-1720834160294.png

It doesn't have any items.


I am wanting to use content from both sharepoint lists in my email. One has a list of students and their behaviours and the second the parents - contractions, names and emails.

Any assistance would be appreciated.

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at

    Hi @Newbie2019 

     

    Firstly well done on the write up, much much appreciated. The detail was perfect.

     

    One other piece of information will help.

    In your Flow Run it shows why the For All didn't run (it had zero records to loop through).

     

    Can you please share the Expression you are using in the For All (input), also if you look on the Run, you'll see where it says show Raw Input, can you grab that please.

     

    Also, if the loop is part of the Second Get Items?? You can add a condition in front to verify if it has 0 or 1+ and then send the email anyway, but only have the data thats available

     

    Whatever you are putting there, is unfortunately Empty, so thats why, so lets verify what is configured there and if its correct. We should be able to solve this quickly


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • Newbie2019 Profile Picture
    238 on at

    Hi @FLMike 
    Thank you for the speedy reply and your assistance.
    I am a little unsure about the For All (not that experienced at this), so will provide what I have:

    For the Apply to each 2 I am using the output of the Get Items 1

    Newbie2019_0-1720835547067.png

    For the Apply to each at the top I am using the first Get Items:

    Newbie2019_2-1720835698033.png

    For the condition 15 I have:

    Newbie2019_3-1720835773009.png


    After the run, I have the following.
    Get items 1:

    Newbie2019_5-1720836003726.png

     

    I did create a compose to see if it was displaying the correct value which it is:

    Newbie2019_6-1720836063867.png

     


    Apply to each 2:

    Newbie2019_4-1720835896814.png



    The second SharePoint list also does have the value:

    Newbie2019_7-1720836207078.png

    To confirm that column BCEID is field_18:

    Newbie2019_8-1720836262247.png


    Please let me know if you need anything else. Thanks for helping.

  • Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at

    Hi @Newbie2019 

     

    Before I get too far in. let me ask a Question, right after your first Get Items, I see you do an Increment Variable.

    Is that just you looping through the records and incrementing by 1???

     

    If so, then remove that, in the initialize Variable do the below. Another primary reason is that Apply to Each is not thread safe, so its possible you won't get a correct value

    Click in the value
    In the Expression Tab type length()
    Then without closing window
    Click Dynamic Properties
    
    Click between the two () (btw it looksl ike there is a space, there is NOT a space)
    once the cursor is between, click on the body/value of the first Get Items
    
    That way it will do a single count value without looping
    

     

    Wait, in your Filter you put the String 'TriggeredBCEID', its supposed  to be variables('TriggeredBCEID') as you defined up top or you can just use the Dynamic Property of the Trigger

    FLMike_0-1720838426958.png


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

  • Newbie2019 Profile Picture
    238 on at

    Hi @FLMike ,
    Thanks for the follow up instructions.
    Yes, the incremental variable did have a value of 1. I have removed that and replaced it with:

    Newbie2019_0-1720849090205.png

    I have also changed the 'TriggeredBCEID' to variables('TriggeredBCEID')

    Newbie2019_1-1720849530785.png


    I hope I have implemented these correctly.
    I completed a trial run with a count value of 15 and the increment variable now displays that in the output:

    Newbie2019_2-1720850371843.png


    However, the condition 15 wasn't met:

    Newbie2019_3-1720850476678.png


    Thanks again.

  • Verified answer
    Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at

    hi @Newbie2019 

     

    Sorry its almost 4am and gotta sleep also, i can't keep looking at the new UI its not giving me what I want.

     

    1. Please switch to the Old UI, top right corner turn the New UI OFF

    2. Please share a Picture with me of the Get Icons filter, opened up so I can see the filter

     

    Something is not right with whatever you are typing in and its giving us (probably) no results still. Because the condition didn't 'fail' it was the Approval that failed.

     

    Please put a Compose before your Get Items, and put the Varable for your Trigger value you want to use in the filter, because I want to see what is going on. 

     

    This shouldn't be that tough really so we need to get it all typed in correctly and be done 🙂 hehe

  • Newbie2019 Profile Picture
    238 on at

    Hi @FLMike 
    Oh sorry. The suns only just gone down here.
    I have turned off the New Designer.
    Yes, there is something wrong with the expression:

    Newbie2019_1-1720857322951.png

     

    Thanks.

  • Newbie2019 Profile Picture
    238 on at

    Hi @FLMike ,
    It was interpreting the value as a column name rather than value as i didn't have single quotes.

    Newbie2019_2-1720858958851.png

    The Get Items 1 now runs okay:

    Newbie2019_3-1720859009834.png

     

  • Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at
    So happy I was able to help you
     
    The new Designer is just not ready yet and makes it harder to see things that might be wrong earlier.
     
    I still do all mine lol in the old ui :-)

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard