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 / Update gallery based o...
Power Apps
Answered

Update gallery based on a passed variable

(0) ShareShare
ReportReport
Posted on by 35

Let's say I initially have 5 buttons: a, b, c, d, e which passed on the same value within a variable. The variable passed on would be used to determine which values are to be displayed on the succeeding gallery.

 

SelectionScreen:

 

buttonA.Onselect: Navigate(Screen1, ScreenTransition.Fade,{value:A})

buttonB.Onselect: Navigate(Screen1, ScreenTransition.Fade,{value:B})

buttonC.Onselect: Navigate(Screen1, ScreenTransition.Fade,{value:C})

buttonD.Onselect: Navigate(Screen1, ScreenTransition.Fade,{value:D})

buttonE.Onselect: Navigate(Screen1, ScreenTransition.Fade,{value:E})

 

Screen1:

Datasource DB contains the following data:

 

Classes    Icon                 A_Value         B_Value       C_Value       D_Value       E_Value

KRD          KRD.jpg                 1                     2

IS              IS.jpg                    11                    22

BS             BS.jpg                   111                222

CAPEX     CAPEX.jpg            1111              2222

 

Gallery1 contains the following from datasource DB:

 

 

ThisItem.Classes              ThisItem.Icon             ThisItem.???

 

What I want to happen is to replace ??? with A_Value if the Button A was selected. The same goes if I choose Button B, B_Value would be displayed. Is this possible? I know I can just replicate the screens and just create a gallery for each but I don't think that it is the simplest way. Please help. Thank you in advance.

 

 

Categories:
I have the same question (0)
  • Verified answer
    BitLord69 Profile Picture
    914 on at

    You could do a If-statement in the Text of the third label/text control instead of the ???

     

    If(value = A, ThisItem.A_Value, value = B, ThisItem.B_Value, value = C, ThisItem.C_Value... and so on)

     

    Good luck!

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard