Showing results for 
Search instead for 
Did you mean: 
Not applicable

Powerapps forms - fields copying to new form issue



I have an issue this afternoon that is bugging me.


I have a Powerapp with three forms, one collects inial data, and then depending on whether it is an accident or near miss (selected from a drop down) and on the dropdown selected it gow to one or the other. For the tests I have just concentrated on Accident. When passed to the second screen I want the fields the user has already filled in to show their contents.


According to threads I could set a variable in the onselect for the drop down and reference it on the next form. This did not work.


So I tried a variation of something else - I took the drop down:



On onselect I wanted the info so far to be written to the Sharepoint list, so we then have an ID for the record, and then I want to copy the ID to be copied to variable   (Ithe SET was orifinally before the IF statement, but I tried shifting it during investigation:




The code:


SubmitForm(Form1_1); If(DataCardValue17.Selected.Value = "Accident" , Set (IDLookup, 'HandS Test 1.0'.ID); Navigate(Incident_Accident, ScreenTransition.Fade)); If(DataCardValue17.Selected.Value = "NearMiss" , Navigate(Incident_Near_Miss, ScreenTransition.Fade))


Now in the 'Accident Form' I wanted to set up a Lookup in the Form Item field:






As you see I have an error - It is Invalid Argument Type.


I cannot get rid of it. I cannot even put it in a label to see what is getting sent. Of course the form does not work when I select Addicent:





The theory does work because if I replace the variable with a row ID from the sharepoint list, it displays the record info:








So My problem must be in the Set statement.


Can anyone advise please (or give me another Noddy way to populate my secondary screens)




Andy Chisholm












Super User
Super User

Re: Powerapps forms - fields copying to new form issue



can you try changing the order of statements and check -


If(DataCardValue17.Selected.Value = "Accident" , Set (IDLookup, 'HandS Test 1.0'.ID); SubmitForm(Form1_1); Navigate(Incident_Accident, ScreenTransition.Fade)); If(DataCardValue17.Selected.Value = "NearMiss" , Navigate(Incident_Near_Miss, ScreenTransition.Fade))


The possible reason could be that as you are submitting the form first, it might be resetting the values and that's why I am suggesting the above.


let me know.

Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Re: Powerapps forms - fields copying to new form issue

Hey AndyC,


  I've read over your post a couple of times and I think I can help you out. Please let me know if I've misunderstood the needs of your application.


  While you could take the partial input and save it to an entry remotely, I don't think that's the best solution. First, it's going to cause additional network roundtrips, which will affect the performance of your app. Second, with that implentation, it's possible for users to end up generating incomplete entries in your Sharepoint list.


  I mocked up a simple app that I think has the relevant functionality you're looking for. It has two screens, I'll go over a brief summary of it now:


  First Screen: "Initial_Input_Screen"


      TextInput: "Initial_Name_Input"


"Enter your name..."


Set(tempName, Initial_Name_Input.Text)


      DropDown: "Initial_Name_Input"


["", "Accident", "Near Miss"]


Set(tempType, Initial_Type_Input.Selected.Value);Navigate(Accident_Input_Screen,ScreenTransition.None)



  Second Screen: "Accident_Input_Screen"


      TextInput: "Accident_Name_Input"




      DropDown: "Accident_Type_Input"




Summary: On our first screen, "Initial_Input_Screen", we've got a pair of inputs, one for the user's name and then another for the type of incident being reported. For each of these controls, whenever they change (captured using their "OnChange" property), we store that value in a corresponding variable (either tempName or tempType). Additionally, the Initial_Type_Input's "OnChange" property navigates us to the next screen.


The next screen, "Accident_Input_Screen", is actually a copy of "Initial_Input_Screen" except for the changes made to each control's "Default" property. With this setup, when we navigate from "Initial_Input_Screen" to "Accident_Input_Screen", the second screen's controls will already be populated with the input from the first screen.


From here, we could extend functionality by adding additional, accident-specific controls to the second screen. At the bottom of this page, you could also add a button to submit the now complete entry to your Sharepoint list.


After that, you could go back and create a third screen to handle your "Near Miss" incidents. At that point, you would need to modify the logic in "Initial_Type_Input" to determine which screen it should navigate to, based upon the selected value.


Obviously, this is a pretty pared down example of what you're doing, but the same basic mechanisms should apply to your situation.


Let me know if this helps you out or if you're still running into problems!



Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,135)