Can anyone advise, how to remove a "…" in a expression?
try(replace(jsonGet({[.]../API Data}, "stateText"), "…", ""), null)
This does not work and the value stays the same.
Thanky you!
Can anyone advise, how to remove a "…" in a expression?
try(replace(jsonGet({[.]../API Data}, "stateText"), "…", ""), null)
This does not work and the value stays the same.
Thanky you!
That is a single character ellipsis. Are you sure that is what you want to search/replace?
Yes sir.
It come from the REST API like this:
{"countErrors":0,"countWarnings":0,"countInfos":1,"currentLabelCount":301,"totalLabelCount":1200,"currentJobCount":1,"stateText":"Printing…","errors":[ ],"timestamp":"2024-03-21T12:46:54.904Z"}
{
"countErrors": 0,
"countWarnings": 0,
"countInfos": 1,
"currentLabelCount": 301,
"totalLabelCount": 1200,
"currentJobCount": 1,
"stateText": "Printing…",
"errors": [],
"timestamp": "2024-03-21T12:46:54.904Z"
}
I've never tried this before with an expression but it seems to work.
if(
jsonGet({value}, "stateText") = "Printing…",
jsonSet({value}, "stateText", "Printing"),
{value}
)
See Types of Tags | Ignition User Manual which may be relevant.
Tips: