Need to create a flow designer to create user and assign role

Supriya13
Giga Expert

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

1 ACCEPTED SOLUTION

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

17 REPLIES 17

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

1.Get Catalog Variables  - done

2. action to create user - unable to get password in that as its mask type 

how to do that

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader