web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to manage multiple...
Power Apps
Unanswered

How to manage multiple forms/galleries

(0) ShareShare
ReportReport
Posted on by 76

I'm working on a Staff Onboarding app.  I have multiple screens configured, each screen with a form to collect information for a particular stage in the onboarding process.  The home screen allows you to either select an existing (in-progress) onboarding from a gallery, or begin a new onboarding.  I am using a global variable to collect the selected person from the gallery (existing onboarding), but have been unable to get the successive forms to load with the record specified in the global variable.  To compound this, I am unclear how I would have the forms reflect if a new onboarding is started on the home screen.

 

Another approach I took was to have the gallery on each screen to drive the form, but then would need a way to synchronize the galleries so that if the same individual is completing several forms for the same onboarding, they do not need to select the name in each gallery.

 

I appreciate any guidance anyone can provide!

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @StaceyGriffeth ,

     

    To have the forms work on the selected item in the gallery as set in the global variable, set the Item property of the forms to reference the variable (i.e. type the name of the variable).

     

    To set the form mode (new or edit), use a second global variable (varFormMode) which you can then set to either FormMode.New or FormMode.Edit in the screen with the gallery, depending on what the user wants to do. Next, set the DefaultMode property for all forms to reference this varible by setting it to varFormMode.

  • StaceyGriffeth Profile Picture
    76 on at

    @BCBuizer thank you for the suggestions!  I followed the steps you outlined, and am still not getting the desired results.  I set two text labels to display the values of the variables so I could ensure they were capturing correctly.  When selecting "New Record", it is setting varFormMode to the value "FormMode.New".  When I select a record from the gallery, it is setting varOnboardingRecord to the record selected, and varFormMode to the value "FormMode.Edit".  In the form, I set DefaultMode to be varFormMode.  I set the Item property to be varOnboardingRecord.  The problem is that when I select a record from the gallery, it is not retrieving that record when I go to the form.  And if I select New Record, the form returns blank, none of the fields even showing.  I presume that's because it's looking for a record where the Title (the Sharepoint column used in the gallery) is blank.

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @StaceyGriffeth ,

     

    Can you please share the Gallery.Items property and the Form.DataSource property? Hopefully that will provide some additional context to tackle this issue.

  • StaceyGriffeth Profile Picture
    76 on at

    @BCBuizer Here's the gallery:

    StaceyGriffeth_0-1706560768275.png

     

    and the Items property:  SortByColumns(Search([@'Employee Onboarding'], SearchInput1_1.Text, "Title", "Title"), "Title")

    Gallery OnSelect:  Set(varOnboardingRecord, ThisItem.Title); Set(varFormMode, "FormMode.Edit"); Navigate('EditOnboardingScreen GenInfo')

    New Record OnSelect:  Set(varOnboardingRecord, Blank()); Set(varFormMode, "FormMode.New"); Navigate('EditOnboardingScreen GenInfo')

     

    And the Form DataSource:  'Employee Onboarding'

    Form Item:   varOnboardingRecord

    Form DefaultMode:  varFormMode

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @StaceyGriffeth ,

     

    I see in the Gallery.OnSelect property you select the Title to populate varOnBoardingRecord, but you must use the entire record:

    Set(varOnboardingRecord, ThisItem); 
    Set(varFormMode, "FormMode.Edit"); 
    Navigate('EditOnboardingScreen GenInfo')

     

  • StaceyGriffeth Profile Picture
    76 on at

    Hi @BCBuizer that fixed that problem!  Now when I click on a record in the gallery, it is correctly opening it up in the form.  However, when I go back to the home screen (where the gallery is) and select New Record, when it navigates back to the form it is displaying the record previously selected.  What do I need to do with the varOnboardingRecord when I select New?

  • StaceyGriffeth Profile Picture
    76 on at

    @BCBuizer Adding on to my last question, there are a total of 5 screens, each with a different form.  If I select New Record, it navigates to the "General Information" screen.  When the new record is begun on that form, and the user selects the navigation button to continue to one of the other forms, how can I have it select that new record on the successive forms?  Do I need to have the new record update the varOnboardingRecord when the first form is submitted?

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @StaceyGriffeth , 

     

    In the New Rord OnSelect property set varOnboarding record to Blank() to resolve the issue where the vakues of the previous record are showing.

     

    To make the navigation dynamic you'll have to either save which was the last completed form or find some conditions that confirm this. Those can then be used in combination with a Switch function to bring the user to the right screen, for instance:

    Navigate(
     Switch(
     ThisItem.LastCompletedForm,
     Blank(), Screen1,
     "Form1", Screen2,
     "Form2", Screen3
     )
    )
    

     

     

  • StaceyGriffeth Profile Picture
    76 on at

    Hi @BCBuizer The new record OnSelect is:

    Set(varOnboardingRecord, Blank());
    Set(varFormMode, "FormMode.New");
    Navigate('EditOnboardingScreen GenInfo')

     

    On the page 'EditOnboardingScreen GenInfo', the form has the following properties

    DefaultMode = varFormMode

    Item = varOnboardingRecord

     

    But when I play the app and click on New Record, it navigates to the correct page but the form is not showing and it says "No Record To Display". 

     

    I added text labels on the form screen to confirm the values of varFormMode and varOnboardingRecord.  varFormMode is correctly reflecting as FormMode.Edit (selecting existing record) and FormMode.New (new record).  I think the issue is with varOnboardingRecord.  Should there be some sort of If statement for the form Item property?

  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @StaceyGriffeth ,

     

    When setting varFormMode, you need to remove the double quotes:

    Set(varOnboardingRecord, Blank());
    Set(varFormMode, FormMode.New);
    Navigate('EditOnboardingScreen GenInfo')

    Like this you set it to a datatype called Enum which will actually cause the FormMode to change along with the change in variable value.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard