web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dynamic Gallery - This...
Power Apps
Unanswered

Dynamic Gallery - ThisItem

(0) ShareShare
ReportReport
Posted on by 41
Hello,

I would like to know if there is any way to make the "ThisItem." of the gallery to be dynamic based on a variable.

Scenario:

1) I have a flow in Power Automate that lists rows in different files and tables in Excel and sends them to Power Apps;
2) When reading in Power Apps I use Set(response, ParseJSON('flowName'.Run().response));
3) And then in the gallery I use Table(response) in the Items property;
4) To show data from a column, I'm adding a Text field and including this Text(ThisItem.Value.NameOfTheColum). It's working as expected.
 
The point is that I have more than 30 tables in Excel to read. And for all tables the name of the first column is different. This way I would need the Text(ThisItem.Value.NameOfTheColum) field to be dynamic based on a variable.
 
For example, for the ideal scenario:
 
Set(varColumnName, Combobox.Selected.Value) - This combobox would list all the options for the names of the first columns of the different tables.
 
And then use it in the gallery to obtain the data from the first column:
 
Text(ThisItem.Value.varColumnName)
 
When I do this, it doesn't return any errors in the formula, but it doesn't show me any data in this field. 

So I would like to know if there is any hidden function or any way I can achieve this.
 
Thanks!
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at
    Other than the minor exception of SortByColumns for field names, you cannot refer to field, data source or control names dynamically, so it will not work in the scenario you have posted.
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Are you just reading data from these Ecel files and not updating   them in Power Apps? If you know the first column name of the particular Excel file you are reading why can't you create a new table with columns named how you wish them to be named? 
  • danilohay Profile Picture
    41 on at
    hi @ronaldswalcott, thanks for the suggestion, but changing the column names is not an option for this process. By the way, I found a way around it, as I know the column names before performing the query, I'm sending the name through Power Apps to Power Automate and then doing a replace, making the column name generic. Then in Power Apps I use this generic name to get the value in the table.

    hi @WarrenBelz, Thanks, that answered my question. I didn't find where I can mark your answer as verified in this new forum interface.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard