- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 03:11 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 03:18 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 03:35 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 03:18 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 03:35 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 03:42 AM
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