cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
agneum
Advocate IV
Advocate IV

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?

1 REPLY 1
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.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (61,424)