I am looking to access the response of a Submit function. I want to use the primary key that was associated with the response and patch it in as a foreign key to another table on the same button click.
I remember reading somewhere that I can access the result of a Submit... but can't find it now.
Solved! Go to Solution.
If you want to get the result of a form submission, you can look at the LastSubmit property of the form control in the OnSuccess property of the form itself.
Below is a (simplified) example of an app that I have. In this app the user can enter orders, which contains different items. The items are stored in a collection, and the order is entered using a form (called Form1 in the example below). When the order is submitted successfully, the form's OnSuccess property (shown below) is executed and inserts all items for the order in the appropriate table, using the id of the recently inserted order as the foreign key.
ForAll( tempItems, Patch( '[PowerAppsTest].[OrderItem]', Defaults('[PowerAppsTest].[OrderItem]'), { OrderId: Form1.LastSubmit.Id, Product: Name, Quantity: Quantity, Price: Price })); Clear(tempItems) Navigate(Screen2, ScreenTransition.Cover)
Hope this helps!
Errr, to clarify, it's the SubmitForm function. Thanks!
If you want to get the result of a form submission, you can look at the LastSubmit property of the form control in the OnSuccess property of the form itself.
Below is a (simplified) example of an app that I have. In this app the user can enter orders, which contains different items. The items are stored in a collection, and the order is entered using a form (called Form1 in the example below). When the order is submitted successfully, the form's OnSuccess property (shown below) is executed and inserts all items for the order in the appropriate table, using the id of the recently inserted order as the foreign key.
ForAll( tempItems, Patch( '[PowerAppsTest].[OrderItem]', Defaults('[PowerAppsTest].[OrderItem]'), { OrderId: Form1.LastSubmit.Id, Product: Name, Quantity: Quantity, Price: Price })); Clear(tempItems) Navigate(Screen2, ScreenTransition.Cover)
Hope this helps!
User | Count |
---|---|
164 | |
90 | |
73 | |
64 | |
57 |
User | Count |
---|---|
213 | |
153 | |
96 | |
88 | |
66 |