Map/transform for a string

I’m trying to convert my UPS status into a readable format.
This is the item:

String Ups_Status “UPS status [MAP(]” (UPS) {networkupstools=“ups1:ups.status”}

This is my

"OL CHRG"="On Line, Charging"
"OB DISCHRG"="On Battery, Discharging"

And finally the errors (depending on the actual status):

Could not find a mapping for ‘OL CHRG’ in the file '’
Could not find a mapping for ‘OB DISCHRG’ in the file ‘’

What I’m doing wrong?

Try escaping the space:

OL\ CHRG=On Line, Charging
OB\ DISCHRG=On Battery, Discharging
1 Like

That works! Thank you, Mark!