Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to pass object from system property to UI Builder

Hari1
Mega Sage

Hi,

I have an system property which stores the object value. When i access the system property from the UI Builder, I see the object with "\" backslash in it.

Below is the system property:

Hari1_0-1737606999368.png

Below is the system property that i am accessing in UI Builder

Hari1_1-1737607089227.png

How can we resolve this issue?

2 REPLIES 2

Nick Parsons
Mega Sage

I have an system property which stores the object value.


No, you have a system property which stores a string (a JSON string), not an object. System properties do not store objects.

Since you have a string, you need to parse the string into a JavaScript object. One way to do that is by using JSON.parse() on your system property value when you're accessing it in UI Builder.

yad_achyut
Giga Guru

Hello @Hari1 

System property stores any thing in the form of string only that is the reason you are getting those backslashes "\" ,
to access the values from the string you are retrieving in your ui builder simply store it in a client state variable after parsing it as "var jsonObject = JSON.parse(jsonString);" and then you can use it with following the key value pair by dot walking to the key and value.