- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 11:03 AM
I need to auto-calculate bytes to a more readable unit (like KB, MB, GB, etc.) through a ServiceNow catalog item variable. I have 2 variable input and output. Utilizing script below, but when testing nothing is happening in the output variable.
1st Variable: Type = Single Line Text, Question = INPUT BYTES VALUE, Name = input_bytes_value
2nd Varaible: Type = Single Line Text, Question = CONVERTED VALUE, Name = converted_value
SCRIPT
Applies on a catalog item view
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 11:19 AM
Hi @CarlosA84304391 ,
Your script is working I have tried it in my pdi
just check if you there any errors in the console
you have this on change client script on the input_bytes_value variable only right? if no update the variable name on the catalog client script to input_bytes_value
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 11:19 AM
Hi @CarlosA84304391 ,
Your script is working I have tried it in my pdi
just check if you there any errors in the console
you have this on change client script on the input_bytes_value variable only right? if no update the variable name on the catalog client script to input_bytes_value
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 11:31 AM
Thank you. I was missing the value in the "Variable name" field of my script. Sometimes you need another pair of eyes.