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 / Create a table with a ...
Power Apps
Unanswered

Create a table with a column name specified in a variable.

(0) ShareShare
ReportReport
Posted on by 149

Hello.  I have a variable, ThisItem.uri, that I want to use as the name of a column in a Table, like so: 

Set(removeMe,Table({ThisItem.uri:1},{ThisItem.uri:2}));

or some variation of the same.  But the syntax checker doesn't like this.  I've tried many variations to try to get a table with this column name including Patch, creating a table with an ordinary column name and then using RenameCoulmns(), etc.  I guess what I'm looking for is something similar to the Evaluate function that would pass the value of ThisItem.uri as the argument. Is this possible in PowerApps? Thanks!

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Baltner Unfortunately this is not possible in PowerApps. The ColumnNames can't be derived from something else.

    Also, you cannot rename them likewise. The new name also has to be a String literal as the doc says,

    RenameColumns( Table, OldColumnName1, NewColumnName1 [, OldColumnName2, NewColumnName2, ... ] )

    • Table - Required. Table to operate on.
    • OldColumnName - Required. Name of a column to rename from the original table. This element appears first in the argument pair (or first in each argument pair if the formula includes more than one pair). This name must be a string (for example "Name" with double quotation marks included).
    • NewColumnName - Required. Replacement name. This element appears last in the argument pair (or last in each argument pair if the formula includes more than one pair). You must specify a string (for example, "Customer Name" with double quotation marks included) for this argument.

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • Verified answer
    Baltner Profile Picture
    149 on at

    I kinda-sorta solved this in a backdoor fashion. Namely, I created a JSON object using ThisItem.uri as one of the property names.  Then I wrapped the JSON object with Table(ParseJSON(varJSON)) to parse it and cast it as a table. The resulting table had (the value of) ThisItem.uri as a column name.

  • Dewie68 Profile Picture
    12 on at

    Hi @Baltner ,

    In the off-chance you see this, can you share how you created the JSON object and how you parsed it as a table? I have the exact same issue, but whenever I try to wrap the JSON object in a table I get an error. Thank you! 

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