- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 12:33 PM
Hey Community,
How can we Store values in JSON format in servicenow in system properties. I want to store multiple values in a single property.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 12:36 PM
Hi @SnowUserDev ,
U can do something like this.
{
"key1":"value1",
"key2":"value2",
"key3":"value3"
}
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 12:39 PM
Hi @SnowUserDev ,
U can create a property of type string n then put the values in the above format.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 12:42 PM
Hello @SnowUserDev ,
if you share your case, we might find another solution than storing in a property.
you can store it in a string property, just go to Properties and store you JSON in a string property type record.
When you are getting the property anfte you use gs.getProperty('<your_JSON_property') use an JSON.parse
var prop = gs.getProperty('<your_JSON_property')
va yourObject = JSON.parse(prop)
/*you logic here with the Object*/
Hope that this helped, if it does you can mark it as helpful and accept the solution.
All the best,
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 12:36 PM
Hi @SnowUserDev ,
U can do something like this.
{
"key1":"value1",
"key2":"value2",
"key3":"value3"
}
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 12:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 12:39 PM
Hi @SnowUserDev ,
U can create a property of type string n then put the values in the above format.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 12:43 PM
Hi @Danish Bhairag2 ,
Thanks so much for replying so quickly. Could you be kind enough to tell me how can I call or use the property in a script.
Thanks