Hi @sivarajan6065 ,
You cannot refer to a column names dynamically, so you cannot do what you want with that structure. As well as ShowColumns needing the actual column hard-coded, having conditional output for a Gallery generally does not work. Something like this (using your column names) should work
ShowColumns(
AddColumns(
NewSpList,
NewCol,
Switch(
SubCategory.Selected.Value,
"Column1",
Column1,
"Column2",
Column2,
"Column3",
Column3,
"Column4",
Column4
)
),
NewSpList,
EmpStatus,
NewCol
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps