- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2023 08:00 PM
I created a Variable set with a reference type variable.
The variable New Approver (new_approver) is hidden and i want to set it mandatory and visible in RITM and SCTASK form when the flow detected that the approver is not active anymore.
but i cannot achieve it by using catalog UI policy in the variable set:
the alert always returning false or maybe the getBooleanValue is undefined that's why it always return false.
Can anyone help me with my script?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2023 08:26 PM
you cannot dot walk 2 levels in client script.
you better use GlideAjax and get the active field value using Script Include and then do the needful
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2023 08:23 PM
If i change my scrip into:
var getStats = g_form.getDisplayValue('requested_for.manager.active');
alert(getStats);
It returning the RITM Number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2023 08:26 PM
you cannot dot walk 2 levels in client script.
you better use GlideAjax and get the active field value using Script Include and then do the needful
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2023 08:50 PM
Hi, I would recommend that you follow Ankur Bawiskars suggestions, and the unexpected results of your 'changed' script test for display value should confirm his post is correct.
Also in your code you were testing a boolean value as a string IE 'true'
so even if the correct value had been returned and assigned to your variable, you would still not have correct functionality in your code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2023 10:13 PM
Hello @Ankur Bawiskar and @Tony Chatfield1 thank you for the idea.
Actually i did this method on my PDI but i din't give any value but upon applying this one on our DEV instance it WORKED!
Thank you so much! I achieved this via GlideAjax