- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2021 07:40 AM
Type field is a list collector....so it consists more than one value....so in that I need to check whether the below sysid is there or not...so I have used indexof method.....it is perfectly working fine....but hardcoding sys id is not a best practice....so I want to replace with system property... is it possible to do without glideajax?
var grType = g_form.getValue('type');
var k = grType .toString().indexOf("d6263df300176cd7da6t54bf2632c");
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2021 08:33 AM
For example I really quickly tested with below. Works instantly. The Client Scripts alerts a 0 (sysid found) or a -1 (no match).
System Property:
Display Business Rule:
onChange Client Script (for testing on Incident watch_list):
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2021 08:33 AM
For example I really quickly tested with below. Works instantly. The Client Scripts alerts a 0 (sysid found) or a -1 (no match).
System Property:
Display Business Rule:
onChange Client Script (for testing on Incident watch_list):
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2021 08:36 AM
I have written business rule and client script on two different tables....is it causing any issue? and please check my above screenshots...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2021 08:38 AM
Different tables? Why is that? Sure that won't work. Any reason for doing so?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2021 08:46 AM
Thanks
issue is due to table name....now working...thank you so much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2021 07:49 AM
Hi,
so you can do this in server side by sending the type value via GlideAjax either from client script of ui policy script
client side
var grType = g_form.getValue('type');
// Ajax here and send the grTypt
// server side inside GlideAjax function
var grType = this.getParameter('sysparm_grType');
var value = gs.getProperty('property_name');
if(grType.indexOf(value) > -1){
// found
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader