cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lars1990
Helper II
Helper II

Store form names in a collection to submit form dynamically

Hi all,

 

I saw a post about being able to dynamically navigate to a screen

 

ClearCollect(screenIndex,
    { Name: "ScreenA", Screen: ScreenA },
    { Name: "ScreenB", Screen: ScreenB },
    { Name: "ScreenC", Screen: ScreenC },
    { Name: "ScreenD", Screen: ScreenD },
    { Name: "ScreenE", Screen: ScreenE })
Navigate(
    LookUp(screenIndex, Name = ThisItem.Screen).Screen,
    ScreenTransition.Fade)

 

I would like to do something similar with submiting a form like the example below. Unfortunatly it gives an error in the collection. Anyone with ideas how to do this?

 

ClearCollect(formIndex,
    { Name: "FormA", Form: FormA},
    { Name: "FormB", Form: FormB },
    { Name: "FormC", Form: FormC },
    { Name: "FormD", Form: FormD },
    { Name: "FormE", Form: FormE })

 

SubmitForm(
    LookUp(formIndex, Name = varForm).Form)
1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Lars1990 

The problem is that your forms have different schemas to them, so you will not be able to store more than one form in your table.  In other words, it's not the submit form that has the issue, it is the schemas of the forms in your Form column of your table.

 

Please consider changing your Formula to the following:

SubmitForm(
    Switch(varForm,
        "FormA", FormA,
        "FormB", FormB,
        "FormC", FormC,
        "FormD", FormD,
        "FormE", FormE
    )
)

 

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!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@Lars1990 

The problem is that your forms have different schemas to them, so you will not be able to store more than one form in your table.  In other words, it's not the submit form that has the issue, it is the schemas of the forms in your Form column of your table.

 

Please consider changing your Formula to the following:

SubmitForm(
    Switch(varForm,
        "FormA", FormA,
        "FormB", FormB,
        "FormC", FormC,
        "FormD", FormD,
        "FormE", FormE
    )
)

 

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!

Perfect! Thanks 🙂

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,375)