In device label, how to use a variable in a function

I’m trying to make a customized label for devices. I want a function to determine device type and output based on that.

I’ve tried:
[if(“AP”=“AP”,“AccessPoint”,“other”)]

this returns either ‘AccessPoint’ or ‘other’ just like you’d expect.

but

[if([Device.Type]=“AP”,“AccessPoint”,“other”)]

this returns literally
[if(AP=“AP”,“AccessPoint”,“other”)]
in the label.

How do I get that device type into the if statement?

is possible to take system identify and add it to device name in dude ?