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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Select Gallery Item in...
Power Apps
Answered

Select Gallery Item in Component

(0) ShareShare
ReportReport
Posted on by 20

Hello! 

I'm new to creating components and having a hard time figuring something....

I am creating a "Tabs" component and I want to select a tab upon visible of the page. Normally, if I created a gallery 'tabs' table I would use:

 Select(Gallery1,varMyTab) 

(varMyTab would be a numerical variable I would set (eg: Set(varMyTab,1)).

 

How to I pass a "Select()" function to my "Gallery1" that is in a component?

 

(if I'm not able to dynamically select a record in the gallery, how do I default Gallery1 in the component to select the 1st record)

Here are some Screenshots to hopefully help explain....

 

EJenn_0-1665778356348.png

 

EJenn_1-1665778410500.png

 

 

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @EJenn 

    Don't think behavioral, think data!!  The Select function is a behavioral function.  It needs to be not only in context, but also used in a behavioral action.  You really don't have this in the component.

     

    Instead, create an input property for your Component called SelectedTab.  Set the component default to 1

     

    Then Set the Default property of your Gallery to:

    Index(Parent._TabItems, Parent.SelectedTab)

     

    Your Gallery Tabs will have the tab that is indicated in the SelectedTab property.

     

    I hope this is helpful for you.

  • EJenn Profile Picture
    20 on at

    @RandyHayes It worked!! Thank you so much for your quick response!!!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     b

  • Nand_Basto Profile Picture
    64 on at

    @RandyHayes What do you mean by : 'Parent._TabItems'

     in your formula. The formula isn't working for me. Using the Index function I am unable to select a gallery tab (item) which is inside the component. Could you please clarify?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard