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:
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)
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.
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"
"Enter your name..."
["", "Accident", "Near Miss"]
Second Screen: "Accident_Input_Screen"
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!
FIll out a quick form to claim your community user group member badge today!
The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!