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 / How do you make galler...
Power Apps
Answered

How do you make gallery selected with a button

(0) ShareShare
ReportReport
Posted on by 945

Hello guys,

 

If I have a gallery with the items is an internal table like : Table ( {Tab:General}, {Tab:Summary}, {Tab:Detail})

And I want to make a button that can force select, lets say "Detail", is it possible ?

 

How would be like in that button "OnSelect" ?

 

Please advice,

Thanks

Categories:
I have the same question (0)
  • Abhilash_Swain Profile Picture
    901 on at

    Could you please share a sample screen, selection all item is possible.But just wanted to be sure on ur requirement.

  • Axal Profile Picture
    945 on at

    Hi @Abhilash_Swain 

     

    Of course. My mentioned gallery is used for " tab pages", something like this ->

    Axal_0-1627380648198.png

     

    And I have a need to have this "Tab page" selected by a button, to direct user for their process step. So by click this button, my apps will be jump to the designated page (which actually just a container visibility to yes)

     

    Thanks,

     

  • Abhilash_Swain Profile Picture
    901 on at

    @Axal  is it something like this?
    Do you want to display all the gallery items when the tab is getting clicked? Or you want to show the selected item data in other tabs. ( like if i select sample 1, attachment and Details screen will show he relevant data for request 1)

     

    Abhilash_Swain_0-1627397203596.png

     

  • Axal Profile Picture
    945 on at

    Hi @Abhilash_Swain 

     

    I'm sorry, it is due my bad explanation. The tab it self is the gallery (horizontal gallery) which is contain that internal table as of now. Like my attached picture, in that gallery I specified the Table in its Item property. 

     

    What I'm tryin to achieve is just to have a button which when I click on it, lets say the button called "Attachment" the the gallery (which is look like Tabs) is changed its selected item to the 2nd which is "Attachments".

     

    Maybe in a simple example of normal gallery  would be like this :

    Axal_0-1627399044008.png

    So at this normal gallery, somewhere in the screen I will have that button, in that button OnSelect I want the gallery to be "force" select the "Caseta Sky Grey" (by code). If for example user click the second button "Beauty Clay", the gallery will then have the 3 rd row selected, with the row name "Ageless Beauty Clay"

     

    So this is the intention while the action after the gallery got selected, it is out of this thread.

     

    Thanks.

  • Verified answer
    eka24 Profile Picture
    20,925 on at

    OnSelect of Button1:

    UpdateContext({varSelect:"Beauty Clay"})
     

    OnSelect of Button2:

    UpdateContext({varSelect:"Caseta Sky Grey"})
     
    Then on Default property of the Gallery:
    LookUp(TableName,ColumnName= varSelect)
    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
  • Axal Profile Picture
    945 on at

    Hi @eka24 

     

    Thanks, it works. But am wondering, why in that gallery actually I put the label name if it selected it will turn blue else will be black. I also have other sign which one is selected by an underline (rectangle object) which will be visible when it is selected. Both of this signage not working.

     

    So it's like this :

    Axal_0-1627408481307.png

    Sorry about the inconsistent of the If condition, but I guess it served the logic, to identify which one is selected.

     

    I put the UpdateContext to set the variable and did put the Lookup in the Default as your example. and it looks working, only this coloring and underline sign (to identify it is selected) not working.

     

    Thanks

     

     

  • Abhilash_Swain Profile Picture
    901 on at

    @Axal , to give a nice transition effect while selecting items, you can switch the transition property in the gallery to Push/Pop. 

    Abhilash_Swain_0-1627409121562.png

    Thanks

    Abhi

  • eka24 Profile Picture
    20,925 on at

    Use this:

    Label

    If(ThisItem.IsSelected,Blue,Red)
     
    Then Visible of the rectangle:
    !ThisItem.IsSelected
     
    or
    ThisItem.IsSelected
    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
  • Axal Profile Picture
    945 on at

    Hi @eka24 ,

     

    I'm sorry, in your example, is it not the one that I did already ? or is it something different ?

    Btw, if I select manually (directly) in that gallery (meaning select/click the tab), this coloring and rectangle is working properly. Only by using that button it's not working. But it did doing the action I expected when I click it, only those identification is not.

     

    Thanks,

  • eka24 Profile Picture
    20,925 on at

    I tested the formula before sending. It works. I don't know why yours is not working. 

    Also I introduced ! In the formula, 

    Then Visible of the rectangle:

    !ThisItem.IsSelected 

     

    Can you show the picture of the full Gallery

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard