Showing results for 
Search instead for 
Did you mean: 
Advocate V
Advocate V

AddColumns and RenameColumns expect string literals...?

Can aynone explain why AddColumns and RenameColumns does not expect anything other than string literals as arguments?

Even doing:

Set(varCol, "testCol" );


Gives a syntax error. 


Works. And after some reasearch I find the following from the article for AddColumns:


Why? How do I rename columns using a lookup or a variable? Why is it static? How can I work around this issue, is it too hard to understand that there might be cases where the column names (or at least what is DISPLAYED) might need to be changed based on circumstances? Like, i don't know, a schedule for example? 

Is there a work around for this or should I just give up?

Community Support
Community Support

I am afraid currently there is no workaround could deal with that, based on my knowledge.

Adding Staff @GregLi to comment more regarding the function usage.





Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Helper I
Helper I

@agneum, I feel your pain. It's been nearly 4 years since your post, and this is still a problem. I'm trying to do something similar with the ShowColumns() function, but can't because of this ridiculous limitation.

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,969)