cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Re: Setting 2 variables, with Button onSelect, on a multi-form, multi-tab, screen

@Steven_Ross_Lee 

No problem with the data source.  That's not an issue here.

 

As for the other point, with a Gallery in place you definitely have less controls to deal with and you can confine your formulas to single areas when needed (much easier to troubleshoot).

 

Let's imagine for a moment that you have a horizontal Gallery (let's call it galFormSelect) with one button in it.  The Items Property of the Gallery might be something like this:

Table(
{btn:"General", ID:1},
{btn:"Contact", ID:2},
{btn:"Dues", ID:3},
{btn:"Appointment",ID:4},
{btn:"Matters", ID:5},
{btn:"Communication", ID:6},
{btn:"Academic", ID:7},
{btn:"Salary", ID:8}
)

The visible property of each EditForm might be like this. 

    Contact Form -  Visible : (galFormSelect.Selected.ID = 2)

    Dues Form - Visible : (galFormSelect.Selected.ID = 3)

    etc...

 

The Save control would have a formula similar to this:

Switch(galFormSelect.Selected.ID,
1, SubmitForm(GeneralForm),
2, SubmitForm(ContactForm),
3, SubmitForm(DuesForm),
4, SubmitForm(AppointmentForm),
5, SubmitForm(MattersForm),
6, SubmitForm(CommunicationForm),
7, SubmitForm(AcademicForm),
8, SubmitForm(SalaryForm)
)

This would give you the same functionality just with a Gallery as your control.  If you're using button in your Gallery, you don't even need to put any formulas in it.  It will automatically have Select(Parent) which will do the "selected" for you and meet all the other formulas.

 

I hope that is clear and helpful.  Post back if you have more questions.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Steven_Ross_Lee
Level: Powered On

Re: Setting 2 variables, with Button onSelect, on a multi-form, multi-tab, screen

I have replaced the buttons with a gallery, and totally see your point. It's working with my IF statements on the Control, but I will change it to the Switch function you have illustrated.

 

Thanks for all your help Randy. You've been great.

 

/Steve

Super User
Super User

Re: Setting 2 variables, with Button onSelect, on a multi-form, multi-tab, screen

@Steven_Ross_Lee 

No problem!  Yes, If statements will work, but I personally find a Switch statement to be much cleaner and easier to diagnose and read.

Good luck with the rest and definitely post back if you have issues.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,992)