user_name on the variable should search the sys_user and update the name on the requested for field

Neethi2
Tera Expert

I have created a variable on the catalog item and the variable should contain the user_name. Once the request is submitted, the requested for should search the user name in the user id and should update the requested for.

 

Neethi2_0-1695828143959.png

Once the request is submitted, the requested for on the RITM should be the name of the user

Neethi2_2-1695828341790.png

 

 

Please help this is very urgent

4 REPLIES 4

Unique45
Mega Sage

@Neethi2 ,

Using flow you can achieve this,

1) Get catalog item variables using 'Get Catalog Variables'.

2) Look up user record whose user_name is mentioned in variable .

3) Update Requested for with user which is getting from lookup record using Update Record Action.

 

Help others to find a correct solution by marking the appropriate response as correct answer and helpful.

 

 

Please mark correct/helpful if this helps you!

I created the flow but is checking the user id where it is empty

@Neethi MS 

Using if condition in the flow you checked user id is empty or not

Please mark correct/helpful if this helps you!

Neethi MS
Tera Contributor

We tried with the below script,but still it is not working and this is a string field "User_Full_Name"

var find_user = new GlideRecord('sys_user');

find_user.addQuery('user_name', current.variables.user_full_name );

find_user.query();

if(find_user.next()){

current.variables.requester_for_hrc = find_user.name;

gs.log(' the found user name is testing' +current.variables.requester_for_hrc );