- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 02:39 PM
Hi,
I am trying to create a new report where I need a new field called 'New Environment'. This needs the first 3 characters from the Configuration Item field.
I have used the 'Configure Function Field' using:
glidefunction:substring(cmdb_ci,'1', '3') However I am not receiving correct result, it displays some jumbled text.
However, if I use this function to display the first 3 characters of the 'Short Description' field, it works fine and displays the characters.
glidefunction:substring(short_description,'1','3')
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 05:40 PM - edited 02-06-2023 07:35 PM
cmdb_ci is a reference field, so substring(cmdb_ci,'1', '3') will get the first 3 characters of the sys_id .
I think you should try dot-walking to get the right one. like glidefunction:substring(cmdb_ci.short_description,'1', '3').
But function fields in reporting do not support dot walking, so create a function field on a table and use it in the report .
I'm not sure if it can work , just have a try.... <--- it works , i have tried.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 05:40 PM - edited 02-06-2023 07:35 PM
cmdb_ci is a reference field, so substring(cmdb_ci,'1', '3') will get the first 3 characters of the sys_id .
I think you should try dot-walking to get the right one. like glidefunction:substring(cmdb_ci.short_description,'1', '3').
But function fields in reporting do not support dot walking, so create a function field on a table and use it in the report .
I'm not sure if it can work , just have a try.... <--- it works , i have tried.