- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 09:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2024 09:47 PM - edited 02-03-2024 09:48 PM
Hi @Ajai007 ,
This code modifies the user source of only 2 Groups having types sys id mentioned in the add query (2nd line) from "REFOG" to "Local Integration".
Also according to me the 2nd line it should be addEncodedQuery() instead of addQuery()
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2024 10:27 PM
i agree with @Mark Roethof perspective too, finding quick answer here will give you temporary answer but you would fall in next hurdle right away.
though script is an easy way to do things not the only way to do it. Here you are looking at a user record from the glass of group membership. The script is trying to update Source for user from “REFOG” to “Local integration” given the group membership conditions are met.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2024 09:10 PM
Hello @Ajai007,
I guess, In the group table members make active ' false'.
Mark my correct and helpful, if it is helpful and please hit the thumbs-up button to mark it as the correct solution.
Thanks & Regards,
Abbas Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2024 09:47 PM - edited 02-03-2024 09:48 PM
Hi @Ajai007 ,
This code modifies the user source of only 2 Groups having types sys id mentioned in the add query (2nd line) from "REFOG" to "Local Integration".
Also according to me the 2nd line it should be addEncodedQuery() instead of addQuery()
Thanks,
Danish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2024 09:50 PM
Hi there,
I think the more interesting question is, what's behind your question? Since you are asking this, it seems that you have no or limited scripting knowledge. Where did you get this scripting then from? What do you want to do with it? What is your intent?
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
02-03-2024 10:27 PM
i agree with @Mark Roethof perspective too, finding quick answer here will give you temporary answer but you would fall in next hurdle right away.
though script is an easy way to do things not the only way to do it. Here you are looking at a user record from the glass of group membership. The script is trying to update Source for user from “REFOG” to “Local integration” given the group membership conditions are met.