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 / Change text in a textl...
Power Apps
Unanswered

Change text in a textlabel depending on which button clicked in gallery

(0) ShareShare
ReportReport
Posted on by 88

Dear community,

 

To give some insight:

- I have a form, where parts of the form are visible depending on which button i click from the gallery (called "MainButtonGallery")

- Each item of the form has as visible: 'MainButtonGallery.Selected.ID=1' or an other digit. 

- I would like to be informed or inform somebody else on which i or he

 

 

I think the gallery pressed button can only change color if pressed and doesn't stay that way. Am i correct?

 

So i thought 'i make a textlabel where the text in it changes depending on which part of the form i'm located (= so which button of the gallery i clicked)'

 

Does somebody have any idea how i could fix this, or maybe a better solution?

 

With kind regards,

 

Miguel

 

 

Capture 1.PNG
Categories:
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @MiguelDeNeve,

    To answer your question:

    I think the gallery pressed button can only change color if pressed and doesn't stay that way. Am i correct?

    Answer: Generally, the button could change color once you click it, it does not change until you click another button in the Gallery.

     

    Do you want to click different buttons to make the corresponding data cards visible and highlight the button in your Gallery, right?

    Well, if so, you need to highlight buttons as long as it is pressed, right?

     

    Here is a simple demo based on above assuming.

    I set the Text property of the Button with ThisItem.ID, so the Button will directly display ID like 1,2,3,4

    1). Set the onSelect property of button as below:

     

    Set(Pressed,true);If(Pressed,Collect(colId,ThisItem),Remove(colId,ThisItem))

     

    2). Set the Fill property of the Button:

    If(ThisItem.ID in colId.ID,Color.Red,RGBA(56, 96, 178, 1))

    vqiaqimsft_0-1682570624437.png

    3). Optional: if you want to reset th variable or clear the collection, you could add a reset button and set OnSelect to:

    Clear(colId);Set(Pressed,false)
  • MiguelDeNeve Profile Picture
    88 on at

    Hi Qi,

     

    Doesn't seem to work for me.

     

    I have a gallery and there is actually only 1 button. It depends on the 'onstart' what i wrote.

     

    The only button in the gallery has as text: ThisItem.Title

     

    What i am looking for is that, when i click on a part of the gallery, which now shows a part of the form, also maybe shows a textbox depending on which part i clicked.


    Mainbutton gallery.PNG
    On start.PNG

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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard