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
Super User
Super User

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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
Super User
Super User

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)
)

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,960)