Forum Discussion
smann
8 years agoHelper I
Can I refer to Table using String?
Here's what I tried to do that didn't work. Replace this: NewTable=#"MyTable" With this: TableName = "MyTable" NewTable = #TableName Is there something I can do along these li...
- 8 years ago
What I had in mind is to create a record for all tables you want to reference.
Query MyTables:
= [My Table = #"My Table", table1 = table1, table2 = table2]
The function that returns the table based on the name of the table:
= (table as text) as table => Expression.Evaluate(table,MyTables)
But why don't you just reference the tables as table? It's quit rare to reference a table by the name of the table.,
smann
8 years agoHelper I
MarcelBeug got it, thanks. It's a very specific situation: I want to pull in a table from a csv and use that to check values in various tables. So one of the columns from the csv is the table name. To automate it, I want to use that column to refer to my tables rather than hard-coding for each table
MarcelBeug
8 years agoCommunity Champion
Thanks for clarifying the context. Well appreciated