Tag DataQuality to Int

I’m sure I need to convert the dataquality of a tag to an Int to evaluate it and give me an Int out but I’m having problems getting to toint to work. I’m sure I’m missing something.
Can anybody help out.

toint ([.]tag.Quality)

if ([.]tag.Quality=1,1,0)

What I want is if tag quality is good then 1 else 0

You need to use 192 instead of 1 in your expression. 192 correlates to good taq quality. tag quality represents many different states, not just good or bad.

docs.inductiveautomation.com/di … d+Overlays