Hi
Upon working with the ServiceNow macro’s and I seem to be faced with a common SN issue about querying the incident table and asking for the state of the incident. This returns the Value and not the Label.
I have temporarily got a workaround by using the Switch macro, but I hoping to be a bit more dynamic where I don’t have to adjust the template when a new state is created etc. So I was looking into just providing a list of all the applicable states and then look up the label from the value.
I have the objects with the properties after using this:
[ServiceNow.List:
query=“element=state^name=Incident”,
table=sys_choice,
properties=label;value,
=>States
]
The objects are returned like this:
[
{
“label”: “New”,
“value”: “1”
},
{
“label”: “In Progress”,
“value”: “2”
},
So my question is, if I have a table using RepeatRow and have the value appearing in the field, if I was to storeAsHidden, that I can then use that variable as a lookup of the value to return the applicable label.
Looking for the most efficient suggestion without having to over complicate it, and sure I am just missing something fundamental.