cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
agneum
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" );

ClearCollect(CollectionTest,AddColumns(table,varCol,true));

Gives a syntax error. 


ClearCollect(CollectionTest,AddColumns(table,"testCol",true));

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

herwegoagain.png


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?

2 REPLIES 2
v-micsh-msft
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.

 

Regards,

Michael

 

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.
cjnunn
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

Announcements
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)