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 / Switch Text of a Galle...
Power Apps
Answered

Switch Text of a Gallery label with btn

(0) ShareShare
ReportReport
Posted on by 32

Hi

I have a gallery with a title, subtitle, and Label (see image). The text for each is set with Text - ThisItem.xxx

I want the OnSelect for btnAccessResource to change the text in Subtitle1_1 from Text - ThisItem.Services, to Text - ThisItem.Contact.

Is there an OnSelect function that can help me do that?

 

GalleryGallery

 

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    @YanivD ,

    Set a Variable on the OnSelect of the Button

    UpdateContext({varPressed: true})

    On the Text of the gallery Label

    If(
     varPressed,
     ThisItem.Contact,
     ThisItem.Services
    )

    also at Screen OnVisible

    UpdateContext({varPressed: false})

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Verified answer
    YanivD Profile Picture
    32 on at

    Wow. Thank you! This is close to perfect. 

    The one issue I am having is that with this solution all Gallery items display the contact info and I want only the selected item to display this info (This is critical bc I am tracking users' clicks on each resource that they request to access). 

  • Verified answer
    WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    Hi @YanivD ,

    Try this then

    If(
     ThisItem.IsSelected,
     If(
     varPressed,
     ThisItem.Contact,
     ThisItem.Services
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • YanivD Profile Picture
    32 on at

    Perfect! Thank you so much!!! 

    I now still need to figure out why images on SharePoint are not showing on iOS... but this will be a new post 🙂

    Thank you @WarrenBelz

     

  • WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    Hi @YanivD ,

    This blog of mine may be of some use to you.

  • YanivD Profile Picture
    32 on at

    First Thank You again but alas I was not able to follow

     

    I placed my images in a sharePint Picture Library

    I am currently using for my Gallery images - ThisItem.CategoryImage, ThisItem.ResourceImage... which, as you explain, does not work on my iPad, iMac-Safari

     

    How exactly do I implement your "ThisItem.'{Thumbnail}'.Large" solution in my Gallery?

     

     

  • WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    Hi @YanivD ,

    If you add the Library with Power Apps to your Data Sources in Power Apps and have this (or a filtered version of it) as the Items of a gallery, then an Imager control with

    ThisItem.'{Thumbnail}'.Large

    will show a thumbnail of the file for most file types (Image, Word. PDF) and on the OnSelect of the Image control

    Launch(ThisItem.'Link to item')

    will open it.

    How are you displaying your images presently ?

     

  • YanivD Profile Picture
    32 on at

    Thank you @WarrenBelz 

    I am currently using a Picture Library on an Org-wide SharePoint Team site and then within the app "ThisItem.CategoryImage" for each item (which displays on iMac Chrome but nowhere else...)

     

    Screen Shot.png

    I am not sure I understand "add the Library with Power Apps" and the subsequent code. Could you share with me a bit more info on the steps for accomplishing this?

    Thanks

  • WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    @YanivD ,

    You have one of those old redundant Picture Libraries - they do not "play well" with Power Apps - my code refers to a normal Library (which has been the only one available for a number of years).

  • YanivD Profile Picture
    32 on at

    Thank you @WarrenBelz 

     

    Here is what I am trying to do:

    I have two galleries: Categories and Resources (under each category)

    User chooses a category and accordingly gets options on the resources gallery to compare and select (as above)

     

    The Data source for the two galleries is dynamic Excel with 2 tabs/Tables (image column contains links to SharePoint)

    Users' selection are tracked captured in a SharePoint list

     

    So far all good (with your help) aside from images not populating on Safari and mobile devices

    Per your last post, I created a SharePoint library with images and added it to PowerApps as a data source.

     

    How do I get images to populate from this library into each of the galleries?

     

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 337 Most Valuable Professional

#2
11manish Profile Picture

11manish 173

#3
Valantis Profile Picture

Valantis 86

Last 30 days Overall leaderboard