cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yan91
New Member

Submit different form to different data sources

I have created 2 form in 1 apps, these 2 forms are created for different purposes, so only required to fill in either 1 form. 

The submission of the form will have to link into different sharepoint list, does anyone have any ideas on this? 

 

Currently i am using the " SubmitForm(form1) ; SubmitForm(form2)", it seems like not so right in this case. 

 

Appreciate if any could help on this. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Front screen, I assume you have a dropdown the user selects the option

StalinPonnusamy_0-1634311460866.png

 

Set(UserSelection, Dropdown1.Selected.Value); Navigate(EditScreen1);

In the Edit screen, Set the Form visibility based on the selection

Set Visible property of Form1 to 

UserSelection="Option 1"

 

Set the Form 2 Visible property to

!Form1.Visible

 

In the Submit button

If(UserSelection="Option 1", 
SubmitForm(form1),
SubmitForm(form2)
)

 

View solution in original post

6 REPLIES 6
StalinPonnusamy
Community Champion
Community Champion

Hi @Yan91

 

As you said, you have the logic to use either of the forms. We can use the same logic white submitting.

 

Set the OnSelect property of the submit button to

If(condition, 
SubmitForm(form1),
SubmitForm(form2)
)

 

Note: Update the condition based on how to determine which form

RandyHayes
Super User
Super User

@Yan91 

In your case, I would use the built in capabilities of the form to control the submit.

So, on Form1, set the OnSuccess action to : SubmitForm(Form2)

Then change your original formula to : SubmitForm(Form1)

 

This way, if the first submit is successful, then the form will automatically submit the second form.

 

Now, not sure from your statement if the fact that you have 2 forms, that a user will fill in one or the other, or if the user is only filling in one form, but the second form needs to submit as well.

If that is the case, the approach would be a little different, and you would want to utilize logic to determine which form was chosen to be completed and then submit that and then the second.

 

So perhaps clarify a little more on the scenario if the above is not helpful or what you need.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

It is only one of the form are required to be fill in, the another one can be leave blank and only submit the form which have been completed.

Would you please help on the logic to determine which form are required to be choose and completed?

 

StalinPonnusamy
Community Champion
Community Champion

Hi @Yan91 

 

You mentioned, User will be filling in only one form. Can you share the logic/condition? Is it based on form data or the user input?

 

In the front page, there are 2 options for user to choose and will navigate them into form. It depends on user selections, then user only required to fill in that form and submit.

Front screen, I assume you have a dropdown the user selects the option

StalinPonnusamy_0-1634311460866.png

 

Set(UserSelection, Dropdown1.Selected.Value); Navigate(EditScreen1);

In the Edit screen, Set the Form visibility based on the selection

Set Visible property of Form1 to 

UserSelection="Option 1"

 

Set the Form 2 Visible property to

!Form1.Visible

 

In the Submit button

If(UserSelection="Option 1", 
SubmitForm(form1),
SubmitForm(form2)
)

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,190)