cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
illmatic
Helper IV
Helper IV

Send last submitted form ID to Power Automate

I have PowerApps canvas app that is connected to both a SP list and a Flow.   I have a submit button's OnSelect property set to SubmitForm(Form1) and it creates a new item in the SP list.  I have set the Form1's OnSuccess property to send a response to PowerAutomate only if the form was successful.   It is set to 'NameOfFlow'.Run(Form1.LastSubmit.ID) [so it sends only the ID of what was last submitted].   However, this gives me an error which says it's expecting zero arguments. 

 

Have I entered this incorrectly?  

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks @illmatic ,

As you can appreciate now there had to be something very basic wrong as the code should work. At times granular examination "pulling it apart" (such as looking for matching Flow parameters) narrows down the source of the issue.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

11 REPLIES 11
WarrenBelz
Super User
Super User

@illmatic ,

You need to ask for the parameter in the Flow (Ask in Power Apps) - the Flow then expects to be given the number (and type) of parameter when you run it form Power Apps. In this case, you appear to not have asked for any parameters.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

flugaoveltem
Resolver III
Resolver III

Hi @illmatic 

Edit your Automate flow, inside the step add a property, Ask in Powerapps, 

flugaoveltem_0-1607976743671.png

Refresh the flow inside your app, now it should accept a argument. 

I already have this in Power Automate... it's set to GettheItemID....     My problem is that the ID of the last submitted form is not being sent OnSuccess property in PowerApps....

WarrenBelz
Super User
Super User

Hi @illmatic ,

Sounds strange as "expecting zero arguments" error means the Flow is not expecting anything to be sent from Power Apps (nothing to do with your LastSubmit.ID). What does your Flow look like?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

...I stated that the problem is in PowerApps not in Flow?   This expecting zero arguments is what I get when I have set the OnSuccess property of the form in PowerApps.

@illmatic ,

I think we are going in circles a little. "Expecting zero arguments" as an error appears to mean the Flow is not asking for any parameters. Can you please paste an image of your Flow so that theory can be tested.

Half of the flow is as follows:

 

flow_powerapps.png

Thanks @illmatic ,

Sorry to question to that level, but I have no vision of your Power Apps experience and have seen many issues as simple as this in the past. Now it is not making a lot of sense, but try this on the OnSuccess

UpdateContext({varID:Self.LastSubmit.ID});
'NameOfFlow'.Run(varID)

Also when you type in 'NameOfFlow.Run( do you get any parameters requested in the top panel?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

illmatic
Helper IV
Helper IV

Never mind!  I resolved it...   The OnSuccess property did not work because the name of the flow itself had a hyphen in it.  This caused PowerApps to render it as 'NameOfFlow-2'.Run()  and this did not work.  I copied the flow, renamed it to: TestFlowA, and added it to the PowerApps and was able to change the OnSuccess property to TestFlowA.Run(Form1.LastSubmit.ID) with no issue.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,257)