Hi @Sangeetha Priya S ,
I have the same error when I use a dynamic variable for the table name, for example:
let MyTable = () { iff( 1==1, "logsRaw","Telemetry") };
//
table(MyTable)
| take 50
When changing it to a constant variable, it will work:
let MyTable = () { "Telemetry" };
//
table(MyTable)
| take 50
According to the documentation:
A parameter, which isn't a scalar constant string, can't be passed as a parameter to the table()
function.
The workaround:
let T1 = print x=1;
let T2 = print x=2;
let _choose = (_selector:string)
{
union
(T1 | where _selector == 'T1'),
(T2 | where _selector == 'T2')
};
_choose('T2')
Kind Regards,
Wilko
Please do not forget to "Accept the answer” wherever the information provided helps you, this can be beneficial to other community members. If you have extra questions about this answer, please click "Comment".