cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marial16
Post Partisan
Post Partisan

select Gallery tab

Hallo,

 

i have 3 tabs created in a gallery (not single buttons) in the second screen of my app.

on the On Select property of the tab i set a variable Set(varTabSelected,ThisItem.Tab)

 

items Property of gallery:

Table({Tab: 1, Title: "General Info"},{Tab: 2, Title: "Participants"},{Tab: 3, Title: "HR"}).

 

Every time i navigate from Screen1 to the second screen with the tabs i want the first tab to be selected.

 I tried this on a button in new screen but does not work.

Set(varTabSelected,1);

 

Any ideas?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@marial16 

You need not type out so much of that on the OnSelect.

Screen 2: Gallery Tab: OnSelect:   UpdateContext({varTabSelected: ThisItem})

 

You can keep the Screen1 navigation formula as is, or you can also do this in the OnVisible of the screen.  Just depends on if you are only dealing with that screen as always having the first tab selected.

 

But...sounds like you have what you need now! 😉

 

_____________________________________________________________________________________
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!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@marial16 

Assuming you are then putting the varTabSelected variable in the Default of the Gallery.

Please consider changing your Formula to the following:

   Set(varTabSelected, {Tab: 1, Title: "General Info"})

You need to supply a complete record that matches the Items property.  The above will do so.

 

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!
marial16
Post Partisan
Post Partisan

well your help was very important,

 

Following Solution seems to work:

Screen2: GalleryTab: OnSelect: UpdateContext({varTabSelected:{Tab:ThisItem.Tab,Title:ThisItem.Title}})

 

Screen1: NewButton: OnSelect: Navigate(Screen2, ScreenTransition.Fade,{varTabSelected:{Tab: 1, Title: "General Info"}})

 

And of course the Default property of the Tabs gallery: varTabSelected

 

 

RandyHayes
Super User
Super User

@marial16 

You need not type out so much of that on the OnSelect.

Screen 2: Gallery Tab: OnSelect:   UpdateContext({varTabSelected: ThisItem})

 

You can keep the Screen1 navigation formula as is, or you can also do this in the OnVisible of the screen.  Just depends on if you are only dealing with that screen as always having the first tab selected.

 

But...sounds like you have what you need now! 😉

 

_____________________________________________________________________________________
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!

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 (1,037)