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 / Show column's value wh...
Power Apps
Unanswered

Show column's value when column name is taken from 2nd Gallery

(0) ShareShare
ReportReport
Posted on by 85

I need solution for below problem.

I'm taking column name from different table using Gallery2.selected.columnname now I want to show the Gallery2selected.columnname's value in Gallery1.

How to implement this? As for other columns we use Thisitem.columnname but ThisItem.Gallery2selected.columnname is not working.

Categories:
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @rohitkushwaha,

     

    If one specific label within Gallery 1 should reference the selected item in Gallery 2, you can reference the column value by using Gallery2.Selected.ColumnName as the Text property. (No 'ThisItem' needed, this ThisItem refers to the record within gallery1)

     

    //Text property label in gallery 1
    Gallery2.Selected.ColumnName

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • rohitkushwaha Profile Picture
    85 on at

    Hi @LaurensM 
    Thank you for response!

    In second gallery, I'm filtering the data and picking up the Week number from the filtered data then we have a column in first gallery for each week number, so we have to show the week number column.

    As you suggested, I'm getting the filtered value that is 90 in all the rows, it should be 90th column values.

    Text value:

    rohitkushwaha_0-1703783694061.png

    Output:

    rohitkushwaha_1-1703783794264.png

     

  • LaurensM Profile Picture
    12,516 Moderator on at

    @rohitkushwaha,

     

    The value will indeed be 90 across all rows since we reference the selected row in Gallery 2 and display the Week Number column.

     

    What would you like to achieve by selecting 90 as a week number? Are there specific rows within gallery 1 containing '90' as a value for a specific column that you would like to display - in other words only displaying the rows of week 90? Or do you have a specific column within gallery 1 that you would like to display when 90 is selected?

     

    Thanks!

  • rohitkushwaha Profile Picture
    85 on at

    There are rows in Gallery1, so if the week number is 90 we want to show the below data from column 90.
    For example: Gallery contains EmpName, EmpID, WeekNumber 

    rohitkushwaha_0-1703784989782.png

     

  • LaurensM Profile Picture
    12,516 Moderator on at

    @rohitkushwaha,

     

    Thank you for the clarification. Unfortunately native dynamic column selection is not possible within Power Apps.

     

    A possible workaround could be mimicking the dynamic behaviour via a Switch function. However, I would only recommend this approach should you have a smaller set of columns which should behave dynamically. In the example below we have 3 columns called 70, 80 and 90:

     

    Switch(
     Gallery2.Selected.ColumnName,
     70,
     ThisItem.'70',
     80,
     ThisItem.'80',
     90,
     ThisItem.'90'
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • rohitkushwaha Profile Picture
    85 on at

    @LaurensM 
    How to use switch in Addcolumn function.

    Currently I hardcoded '90' but I want to use switch statement as you suggested.

    rohitkushwaha_0-1703852842731.png

     

  • rohitkushwaha Profile Picture
    85 on at

    It working now.

    "AllocPercent",
     Switch(
     Gallery3.Selected.'Week Number',
     1,
     First(Grouped).'1',
     2,
     First(Grouped).'2'
    )

     
    Thanks @LaurensM 

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