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

I want to trigger a flow from Power Apps which will pull data from SharePoint and update few item in share point and send email to users

Hi All,

 

I have created a flow which will be triggred by the click on Powerapp (i will be passing the ID and Title for Sharepoint List) it will check the Sharepoint list for the ID and Title and then it will pull the value (3 Cloumn containing email )from Sharepoint list and it will send an email to all the 3 people we pulled.

 

At the time of trigger i am getting the below error.

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 
'foreach' expression '@{body('Update_item')?
['PTLorSSIndicator']}@{body('Update_item')?
['StaticMechanicalEngineer']}@{body('Update_item')?
['Maint_x002f_DutyEngrIndicator']}@{body('Update_item')?
['Inspection_x002f_CivilEngineer']}@{body('Update_item')?['CorrosionEngineer']}'
 is of type 'String'. The result must be a valid array.

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: I want to trigger a flow from Power Apps which will pull data from SharePoint and update few item in share point and send email to users

Hi @VivekBhatt ,

Could you please share a screenshot about your flow's configuration?

Could you please share a bit more about the 3 columns contains email that you mentioned? Are they all Single text type columns in your SP list?

Do you want to retrieve the specific record from your SP list based on the passed ID value and Title value from your app?

 

Based on the error message that you provided, I think there is something wrong with the "Apply to each" action and "Update Item" action within your flow. Please check if you have type a proper expression within the "Apply to each" action and "Update Item" action in your flow.

 

Actually, it is not necessary to pass both ID value and Title value from your app to your flow. The List Item ID (ID value) could identify one record in your SP List uniquely.

 

I have made a test on my side, please take a try with the following workaround:

The data structure of my SP List as below:2.JPG

The app's configuration as below:3.JPG

 

The flow's configuration as bleow:4.JPG

 

5.JPG

On your side, please consider re-create a new flow based on above flow's configuration, then re-add the new flow connection within your app, trigger your flow agian from your app, then check if the issue is solved.

 

In addition, please also check if you have typed a proper expression within your "Apply to each" action. More details about using expression in flow actions, please check the following blog:

https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/

More details about WDL expression supported in flow actions, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#f...

 

More details about firing a flow from an app, please check the following video:

https://www.youtube.com/watch?v=1wl9AtxWdkg

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
VivekBhatt
Level: Powered On

Re: I want to trigger a flow from Power Apps which will pull data from SharePoint and update few item in share point and send email to users

Hi Kris,

 

I am using People Finder (People or Group) type to store user name in 5 different coulmn.

All colums can have multiple values, Yes you are right i am getting "Apply to each" action everytime i am trying to work on this.

I am using the same setup in flow.

Really sorry can't share the screenshots. 

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 248 members 5,195 guests
Please welcome our newest community members: