cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kevingeorget
Level 8

Flow failing when called from PowerApps form

I've a flow that's triggered from my SharePoint PowerApps form.

There are four buttons in the form that calls the same flow but with different parameters as below-

1. SubmitForm(SharePointForm1); 'TestFlow'.Run(SharePointForm1.LastSubmit.ID,"Complete")
2. SubmitForm(SharePointForm1); 'TestFlow'.Run(SharePointForm1.LastSubmit.ID,"Reject")
3. SubmitForm(SharePointForm1); 'TestFlow'.Run(SharePointForm1.LastSubmit.ID,"Approve")
4. SubmitForm(SharePointForm1); 'TestFlow'.Run(SharePointForm1.LastSubmit.ID,"RejectInputs")

 

Whenever i make a change to the PowerApps form and publish it (changes not related with the flow button or parameters), this flow tend to fail on the next run.

The error is-

Flow Error.PNG

 

From the flow run, i could see the Item ID is correctly passed.

The fix currently i do is to remove the reference of the flow from the form and re add it again for each of the 4 buttons and publish it again.

Any reason why this error occurs?

 

2 REPLIES 2
Microsoft v-siky-msft
Microsoft

Re: Flow failing when called from PowerApps form

Hi @kevingeorget 

 

Can you share more details with your flow? Have your ever do any changes to the list (add/remove/change the column)?

Currently, I am not sure how does this error happen because the lack of information, but you can try to remove and re-add the flow to check if it can work well.

Also, could you try to create four flow with the same action, assign them to each button to check if this issue is fixed?

Best regards,

Sik

Highlighted
kevingeorget
Level 8

Re: Flow failing when called from PowerApps form

Thanks @v-siky-msft for the reply.
Let me try explaining the scenario-

Out of the many fields in my list, i have a status field which can take values 'Pending' and 'Send for Review'.

When Status is 'Pending'-
Two buttons are visible-
Complete and Reject

When Status is 'Send for Review'-
Two buttons are visible-
Approve and RejectInputs

OnSelect property for the buttons are as follows-
Complete- SubmitForm(SharePointForm1); 'TestFlow'.Run(SharePointForm1.LastSubmit.ID,"Complete")
Reject- SubmitForm(SharePointForm1); 'TestFlow'.Run(SharePointForm1.LastSubmit.ID,"Reject")
Approve- SubmitForm(SharePointForm1); 'TestFlow'.Run(SharePointForm1.LastSubmit.ID,"Approve")
RejectInputs- SubmitForm(SharePointForm1); 'TestFlow'.Run(SharePointForm1.LastSubmit.ID,"RejectInputs")

 

As you can observe its the same flow that gets called, but the 2nd parameter changes. And in my flow, i use a Switch case to handle the 4 cases.

#Have your ever do any changes to the list (add/remove/change the column)?
No. I update the PowerApps form and publish it at times without touching the above functionality. But this throws the error mentioned.

#but you can try to remove and re-add the flow to check if it can work well.
if i remove and re-add the flow, the issue gets fixed, But at a later stage, if i publish this again, the issue crops up again.


#Also, could you try to create four flow with the same action, assign them to each button to check if this issue is fixed?
Created 3 duplicate flows and assigned each one to the buttons. The error still appears after i make some change at a later stage.

oneflowerror.JPG

The powerapps trigger gets the item id correctly, but still the Get item action fails.

 

oneflowerror2.JPG

 

Generic Error in detail-

Unable to process template language expressions in action 'Get_item-_Task_Item' inputs at line '1' and column '2228': 'The template language expression 'json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_sharepointonline']['connectionId']' cannot be evaluated because property 'shared_sharepointonline' doesn't exist, available properties are 'shared_sharepointonline_2, shared_office365_1, shared_outlook'. Please see https://aka.ms/logicexpressions for usage details.'

 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,272)