user role check/add
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 07:08 AM
Hello,
I need help with this task:
I need to do a script to check that the inserted user has the 'user' role, I'll add it if it doesn't (Insert on sys_user_group)
if I add the role I send the user an email informing him that he has become a customer
I will add the current user in the salesperson field,
entry date will be valued with today's date
thanks for the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 08:06 AM - edited 01-16-2024 08:20 AM
Though this can be achieved with code for any role (not sure which user role you're referring to however), but you may want to instead consider flow designer for the less code savvy devs who need to maintain this in your team.
I had a similar use case recently but then to remove roles:
In flow designer:
1. Add a trigger on sys_user
2. Look up group member records where role is empty
3. For each item in records found in step 2
4. Update record
5. Add notification if needed
If my post helped you, please click the accept solution button and hit the thumbs up! Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 08:08 AM
Hi @madalinus1
What do you mean by User role? Is it custom role?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************