How to submit multiple forms in Canvas App to a single record
-
How to submit multiple forms in Canvas App to a single record
Posted by DSC Communities on December 5, 2019 at 6:28 pm-
Alison Hui
MemberDecember 5, 2019 at 6:28 PM
Dear Power Apps Community,Does anyone know how to submit multiple forms in Canvas app to a single record?Ā I’ve been researching online trying to use the Patch function without success.Ā Ā
My scenario: I have (4) Edit Forms with different Fields.Ā On my last Form (Form 4), I’d like to submit all data from previous Forms 1, 2 and 3.Ā
Below is another page I referenced using varFormMode, varRecord and varSubmitMode.Ā Ā
https://wonderlaura.com/2019/04/17/powerapps-form-across-multiple-screens/ĀIf you have a successful formula that works, any help would be greatly appreciated!Ā Thank you.
——————————
Alison
—————————— -
Hello Alison,
In All the forms keep a ID columns common and on final screen use Addcolumns() Function in gallery which you can patch all items on submit button.In browse gallery.items:
AddColumns(datascource,”columns”,expression-> lookup on ID column,”columns”,expression-> lookup on ID column,”columns”,expression-> lookup on ID column,….)
On Submit Button:
Patch(mainsource, ForAll(Gallery.AllItems,{Key:Value}))Hope this solution work. All the best!!!
——————————
Maulik Domadia
Software Engineer
AHMEDABAD
——————————
——————————————- -
Kenneth Nicasens
MemberDecember 6, 2019 at 2:51 AM
Alison,Another way of doing this could be to create a collection with the same datasource as your form datasource and patch everything in each step to the collection.
This way you ‘stage’ the data and on the last submit you patch your collection to the datasource. Normally this will also be quicker in the end than go over all forms and patch them 1 by 1 to the datasource.——————————
kenneth Nicasens
9160
Cegeka
——————————
——————————————- -
Peter Heffner
MemberDecember 6, 2019 at 3:59 AM
Hi Alison,
I have seen timing problems when submitting multiple forms to the same data.
It looks like the first submit hasn’t been completed when the second submit sort of interrupts and start it’s own submission and so on.
If I have to deal with many fields and would like to spread them over multiple screeens this is what I do:– Create one single EditForm/NewForm on the screen with all fields.
– Add button controls (which would represent a screen). Let’s assume you want 2 screen, so it is Button1 and Button2
– For the buttons set the OnSelect action to ‘UpdateContext({_selTab:”Button1″})’ and ‘UpdateContext({_selTab:”Button2″})’
This way you know which button has been pressed.
– Also for the buttons set the DisplayMode to ‘If(_selTab=”Button1″,Disabled,Edit)’ and ‘If(_selTab=”Button2″,Disabled,Edit)’ for the 2nd button.
This makes it easier for the user to see which button is selected.
– Next select the first datacard and change the ‘Visible’ value from true to ‘btn_screen1.DisplayMode=Disabled’ if you want this datacard be visible on the first screen (Button1).
If you want another datacard be visible on screen 2, set the ‘Visible’ value to ‘btn_screen2.DisplayMode=Disabled’With other words:
If you click Button1 the DisplayMode of the button becomes disabled.
The datacard visible parameter checks if Button1 = disabled. This is a boolean result, true or false and will be used for Visible = true/false.The advantage is you deal with just 1 form and can submit it easily.
I hope I could help here.
——————————
Peter Heffner
Intranet Solution Specialist III
——————————
——————————————- -
Chad Kealey
MemberDecember 6, 2019 at 8:23 AM
SeeĀ https://www.youtube.com/watch?v=M_PCH55vf6EĀ for a technique that’s worked for me. Basically, using Patch, you can useĀ “formName.Updates” from one or more forms as the ‘update’ parameter(s) to the Patch command.——————————
Chad Kealey
——————————
——————————————- -
Sara Hopp
MemberDecember 6, 2019 at 10:08 AM
Alison,
I have found a somewhat easy way to do this using the Patch command:
?I created about 7 screens collecting data and I have some navigation and branching.
All screens ultimately end in one screen and on that screen I have a Submit button with the following command on the On select:Patch( ‘DataSource’, Defaults(‘Datasource’), EditForm2.Updates,EditForm3.Updates,EditForm4.Updates,EditForm5.Updates,EditForm6.Updates,EditForm7.Updates,EditForm8.Updates);Navigate(BrowseScreen1)
This seems to work great.
This article was very helpful for me: https://www.spsimply.com/home/powerapps-submit-multiple-forms-at-once
——————————
Sara Hopp
Senior Software Support Specialist
Pine Street Inn
Boston, MA
——————————
——————————————-
DSC Communities replied 5 years, 9 months ago 1 Member · 0 Replies -
-
0 Replies
Sorry, there were no replies found.
The discussion ‘How to submit multiple forms in Canvas App to a single record’ is closed to new replies.