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

Flow fails when SharePoint list item updated to allow multiple email addresses in People Picker

I had a SharePoint form that had four People Picker fields that were all used to send status and update reminders to all names entered therein. All of this was established and working well for a long time, but then it was requested I update the People Picker fields to allow multiple names because the list item responsibilities sometimes bridge multiple shifts.

 

I did this and it worked fine in the list, no issues, but now suddenly my reminder Flow is failing with this error:

 

InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_from_a_shared_mailbox_3' inputs at line '1' and column '2635': 'The template language expression 'triggerBody()?['Engineer_1']?['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.'.

 

Note that Engineer_1 is the field that (now) has two names/addresses in it.

 

I am a Flow newbie, so my questions are A.) can a flow extract multiple email addresses from a list item and add them both to the "To" of "CC" address? And B.) What is different vs. using a single email that I am clearly missing here?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flow fails when SharePoint list item updated to allow multiple email addresses in People Picker

 

Hi @Daryl_K ,

 

Please try this, use variables to store all emails in the person field and configure variables to Send an email action:

122.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

5 REPLIES 5
Super User
Super User

Re: Flow fails when SharePoint list item updated to allow multiple email addresses in People Picker

If the email is a Shared Email Box,  then who ever triggers the flow must be a member of the shared email box

 

I found this a big issue with powerapps as it a the user of the app that triggers the flow.  I had emails embeded in teh flow that were from a Shared MailBox.  They failed because of this issue.  Never failed in testing as I was the user and I had access to the mailbox

 

 

Super User
Super User

Re: Flow fails when SharePoint list item updated to allow multiple email addresses in People Picker

The reason your flow is failing is because the original flow a people field was returning 1 value, now it can return many.

 

Remove the people field from the send an email action and re-add it, it will automatically add an apply to each for you.

Community Support Team
Community Support Team

Re: Flow fails when SharePoint list item updated to allow multiple email addresses in People Picker

 

Hi @Daryl_K ,

 

Please try this, use variables to store all emails in the person field and configure variables to Send an email action:

122.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

Daryl_K
Level: Powered On

Re: Flow fails when SharePoint list item updated to allow multiple email addresses in People Picker

Well, this seemed close to the fix. Not sure if I did something wrong, but the FLow does have several branches, so I did exactly as you describe to all three fields that could possibly contain more than one email address in the "main" trunk of the Flow, including the Apply to Each and Append actions, then used the "_Email" variant of each in my "To" field, but now I am getting this error message:

 

InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_from_a_shared_mailbox_3' inputs at line '1' and column '2632': 'The template language expression 'triggerBody()?['Assigned_to']?['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.'.

 

Being quite new to FLows I am uncertain what is meant by "Array elements can only be selected using an integer index."

Daryl_K
Level: Powered On

Re: Flow fails when SharePoint list item updated to allow multiple email addresses in People Picker


@v-bacao-msft wrote:

 

Hi @Daryl_K ,

 

Please try this, use variables to store all emails in the person field and configure variables to Send an email action:

122.PNG

 

Best Regards,


Thank you! I turns out yours was the solution! I had some formatting errors, and I actually had a much larger number of people picker fields than I had shown, but once I worked out my goofs (and you MUST incldue the semicolon shown in your example) it worked fine.

 

The bigger challenge was that I actually had two flows on this list, with the second one doing a scheduled scan and sending emails based on inactivity and the like. That one was fun becuase my test runs were including dozens of people on the emails, until I figured out that the variables were "stacking" email addresses in-between lists entries. That was when I had the idea of one more string variable called "null" and created as empty, then at the end of each "Apply to All" I set all of the email variables equal to null variable, and that fixed that!

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate 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 Power Automate Community Video Gallery!

Users online (4,389)