- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2022 11:37 PM
Created a catalog item with variable
1. Company name > refernce
2. user name > string> autopuplated
3. password > mask type
Need to create a flow designer to create a new user and assign the role to him.
I start with trigger > service task , also add get catalog variable , and stuck at action to create a user
how can I create user and assign role to user
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2022 01:05 AM
Hi,
you need to use inline f(x) script to unmask and then set the value for password field
Sample script below
var password = fd_data._1__get_catalog_variables.passwordVariable.getDecryptedValue();
return password;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2022 12:06 AM
Hi,
So what have you tried so far and where are you stuck?
you can use Get Catalog Variables action in flow
Then you can use Create Record action and set the individual field values
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2022 12:44 AM
1.Get Catalog Variables - done
2. action to create user - unable to get password in that as its mask type
how to do that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2022 01:05 AM
Hi,
you need to use inline f(x) script to unmask and then set the value for password field
Sample script below
var password = fd_data._1__get_catalog_variables.passwordVariable.getDecryptedValue();
return password;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2022 01:29 AM
Thanks succesully created user and i want to assign the roles to that user so how we can add timer in the flow designer to wait create a user.
OR how we assign role in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2022 08:12 PM
Hi,
Glad to know that my approach worked.
You can use similar action of Create Record to add role to user
Table - sys_user_has_role
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader