Query regarding expression binding in perspective

Hi

I'm trying to bind an expression to the backgroundColor property of a label in Perspective module, the expression checks if the value of a given tag is 1 or 0 and accordingly returns a color.

The tag path of the tag is dynamic

if(tag("[default]Project_ABC/Pune/" + {session.custom.currentLabel} + "/Line_Status").value = 1, '#00D900','#FF4747')

However when I create this expression in Binding Preview it shows Error_Configuration, and after saving it gives an the error on the component when viewed on the browser.

Wanted to know if the expression is correctly configured or I've made some mistake.

PS. When I try to use a hardcoded tag path it works. i.e. the following expression works

if({[default]Project_ABC/Pune/MC1/Line_Status} = 1, '#00D900','#FF4747')

Use an indirect tag binding, then add a map transform to get your desired result.

1 Like

Thank you so much!