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 / Filter data source on ...
Power Apps
Answered

Filter data source on column name

(0) ShareShare
ReportReport
Posted on by 171

I would like to add a screen to my app where a user selects names from a gallery, then make a single selection from a drop down which correlates with column names in the data source. The names and the selected column would be added to a collection and displayed in a table.

 

I've already got the gallery and drop down in place, but how do I reference the selected column to add it to the collection without a lengthy IF() statement?

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Caroline  if you want to refer to a selected item in a gallery the code is as follows

     

    Gallery.Selected.ColumnName

     

  • Caroline Profile Picture
    171 on at

    @Anonymous I've got the gallery reference sorted out, it's referencing the data source column based on the column name selected in the drop down that I can't figure out.

     

    EG.

    Drop down has selections such as email address, cell phone, ethnicity etc. I want to user to be able to select which one they want, and it will add the field of same name from the data source to the table. Thereby producing a table that shows a list of names (from the gallery) along with their email adresses/phone numbers etc (from the drop down). 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Caroline  can you show me screenshots

  • Caroline Profile Picture
    171 on at

    @Anonymous Here you go. So the user selects the person from the gallery on the left, then chooses the columns they wish to see in the table. They would use the chevron to add the details to a collection which is displayed in the table.

     

    ReportSelection.JPG

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Caroline ,

    Do you populate the Dropdown box with column names from your data source?

    Do you want to add data into a Collection based on the name and the selected column?

     

    Based on the needs that you mentioned, I afraid that there is no direct way to achieve your needs in PowerApps currently. The column names within the Dropdown box would not be recognized a actual column name from your data source, instead, it would be recognized as a text value.

     

    As an alternative solution, I agree with your thought. Multiple If functions may be available choice for you. Please consider take a try with it, check if the issue is solved.

     

    Best regards,

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 490

#2
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

#3
11manish Profile Picture

11manish 302

Last 30 days Overall leaderboard