Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Scripting

Shrabanti
Tera Contributor

On the selection of requested for field  org id  should auto populate according to that user

 

Shrabanti_0-1701708180341.png

 

1 ACCEPTED SOLUTION

Samaksh Wani
Giga Sage

Hello @Shrabanti 

 

Go to Record Producer > Open Dictionary of OrgID variable> Under Related Tab, Open Auto Populate Tab.

 

Dependent Question - Requested For

Reference - User 

Dot Walk Path - Field of User Table whose value you want in OrgID field.

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

View solution in original post

3 REPLIES 3

Samaksh Wani
Giga Sage

Hello @Shrabanti 

 

Go to Record Producer > Open Dictionary of OrgID variable> Under Related Tab, Open Auto Populate Tab.

 

Dependent Question - Requested For

Reference - User 

Dot Walk Path - Field of User Table whose value you want in OrgID field.

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

abirakundu23
Giga Sage

Hi @Shrabanti ,

Please try using the below script.

var req_for = g_form.getReference("requested_for",setorgid);

fun setorgid(req_for){ // "setorgid" is callback function

g_form.setValue("org_id",req_for.orgid); // where "org_id" variable of catalog item & orgid is present in User table.

}

Please mark helpful & correct answer if it's really worthy for you.

 

abirakundu23
Giga Sage

Hi @Shrabanti ,

Please accept my solution, it will be useful for future community users.