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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Issue When Trying to S...
Power Automate
Answered

Issue When Trying to Send an Email to Staff Using a SharePoint List as a Routing Table

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm trying to use Flow to send an email to staff members if when the user filling out the form, indicated their department.  

 

List 1:  Ideas (contains the submitted forms from users with an Affected Department field)

List 2: Routing (contains the list of departments (Title) and the list of contacts for each department (Contact)

 

Error:

InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_(V2)_2' inputs at line '1' and column '2707': 'The template language expression 'items('Apply_to_each')?['Contact']?['Email']' cannot be evaluated because property 'Email' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

 

Workflow Details

I'm using Get Items to get the list of departments and contacts from the Routing list in SharePoint (List 2)

Get Items.JPG

Then I'm using a Send an email (V2) after a condition to send an email to each contact for that department.

Conditional Email.JPG

What am I missing?

 

Thanks!

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @Anonymous 

     

    where are you using 'items('Apply_to_each')?['Contact']?['Email']'  in your Flow

    where is the error? can you share screenshot of Flow run with the error

     

    'items('Apply_to_each')?['Contact']?['Email']'  

     

    Contact itself might be a multi peoplepicker field

    hence running 'items('Apply_to_each')?['Contact']?['Email']'  will run in error

     

    you will have to also loop through your contatcs to generate the email id list

     

    example Loop

    'items('Apply_to_each')?['Contact']

     

    within loop item()?['Email']  will give you the individual email

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I'm not a programmer, and just trying to get this task completed.  We don't use Flow very often, so please understand my ignorance in this regard.

     

    Here is a flow run with error.  The error is only at the end of the flow.  The Get Items section does not have an error.

     

    Flow error.JPG

  • RezaDorrani Profile Picture
    12,145 on at

    Hi @Anonymous 

     

    screenshot of flow in edit mode please

    and the send email V2 action expanded (you can make sure u hide information if confidential)

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Here is the entire workflow in edit mode.  Thanks!

    FS4.JPGFS1.JPGFS2.JPGFS3.JPG

  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    Hi @Anonymous 

     

    Your Contact column is a multi select people picker column

    hence you will need a double for loop

     

    this will send individual emails to every contact

     

    Capture.PNG

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I hope that I did it right.  Here is what I did:

    FSA.JPG

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I get this error:

    FSB.JPG

  • RezaDorrani Profile Picture
    12,145 on at

    @Anonymous 

     

    do a test run

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks.  The test run was not successful.

     

    FSB.JPG

  • RezaDorrani Profile Picture
    12,145 on at

    @Anonymous 

     

    remove contact.email in your second for loop

     

    and re-add it from dynamic content

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard