Query from System Property

user_lm
Tera Contributor

Hi,

We have a requirement to create a property with an encoded query and use it in scripts, I am unable to use the query that was defined in system property. Please help

Example: 'active=true^u_xIN'+current.getValue('field') + "," + current.getValue('field2)

 

Thanks in Advance

 

2 ACCEPTED SOLUTIONS

NitishKumar0012
Tera Guru

Hi,

 

In system property dynamic content will not work...

if you want to use dynamic content, in script itself you can append dynamic values after fetching the encoded value from system Property.

View solution in original post

Ankur Bawiskar
Tera Patron
Tera Patron

@user_lm 

the system property can be used to hold static content

as per your above case you can store this in system property -> active=true^u_xIN

Then update it as this

gs.getProperty('propertyName') + current.getValue('field') + "," + current.getValue('field2)

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

NitishKumar0012
Tera Guru

Hi,

 

In system property dynamic content will not work...

if you want to use dynamic content, in script itself you can append dynamic values after fetching the encoded value from system Property.

Ankur Bawiskar
Tera Patron
Tera Patron

@user_lm 

the system property can be used to hold static content

as per your above case you can store this in system property -> active=true^u_xIN

Then update it as this

gs.getProperty('propertyName') + current.getValue('field') + "," + current.getValue('field2)

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Community Alums
Not applicable

Hi @user_lm ,

I system properties you can not use current, it will store there as a string so in that case you can create one system property and add "active=true^u_xIN'" this query, in the 2nd part you have current there so you can write like 

gs.getProperty(<Name of your property>)current.getValue('field') + "," + current.getValue('field2');

 

Please mark my answer correct and helpful if this works for you

 

Thanks and Regards 

Sarthak