ServiceNow fetching the configured Choice label of a column

Started by Manj75, September 30, 2019, 14:56:32 PM

Previous topic - Next topic

Manj75

Hi Herve,

I am looking for a way to fetch back the configured Dictionary Entry -> Choices -> Label instead of the field/column held in the database.  I wonder if this is possible using the filter.  I did search and found the &sysparm_display_value=true|false|all, but this made no difference.

The sys_class_name column that is the 'Class' by default return the cmdb_ci_* table name, however in the Dictionary Choices we have configured display labels that are dynamically shown in SN, e.g. cmdb_ci_app_server is substituted with 'Application Servers'.  Do you know of how I can get the display lablel and whether this can be done using the filer in the Archi ini.

I'm new and learning ServiceNow and look to your wisdom.

Thanks,
Manjit

Manj75

I've figured this out and it can be accomplished by using the ServiceNow parameter on a filter as follows:

&sysparm_display_value=true

Adding this to the filter on the mapping is expected to achieve the desired result:

archi.elements.cmdb_ci_app_server.filter= &sysparm_display_value=all

However, there is a bug in that all values will be returned with the display value including the 'operational_status', which will have a String value of "Operational" for the the integer equivalent 1.  The plugin code only handles the number format so throws a NumberFormatException when a string is read.  I've raised this as a bug on GitHub.

Hervé

Ok, I'll fix the NumberFormatException in the next release.

Best regards
Hervé

Manj75

If you can support all variations of the parameter:

`&sysparm_display_value=false`
This is the current behaviour

`&sysparm_display_value=true`
Only brings back the configured Choice display labels

`&sysparm_display_value=all`
Brings back both the Choice display labels and the raw database value

Thanks,
Manjit