Need to display the options based on values populated in another variable

suuriyas
Tera Contributor

HI Community,

 

I have a requirement, in catalog form we have these variables business controller approver and select approver 

Business controller approver field will auto populate based on the reporting unit selected in the form

now i want the populated values to be display as the option in select the approver field

For example in form x reporting unit is sleected and the user populated in controller approver as A and B then only these two user A and B need to be as a option in select the approver variable 

suuriyas_0-1743510477669.png

How can we achieve this

1 ACCEPTED SOLUTION

@suuriyas 

so it should show approver from variable "business_controller_approver" and the approver/user present in the field "vendor_business_controller" on reporting unit table

then do this, ensure you give the correct variable name for reporting unit

javascript:'sys_idIN' + current.variables.business_controller_approver.toString() + ',' + current.variables.reportingUnitVariable.vendor_business_controller.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@suuriyas 

you can use advanced ref qualifier in "Select the approver" variable

something like this

Ensure you give the correct variable name and the correct field within the table which holds approver.

I assume "approverField" within that table is list type and refers sys_user and the approver variable also refers sys_user table

javascript:'sys_idIN' + current.variables.businessControllerVariableName.approverField.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

HI @Ankur Bawiskar ,

Thanks for replying 

 

I tried like this but in form it is showing as no record.

javascript:'sys_idIN' + current.variables.business_controller_approver.vendor_business_controller.toString();

suuriyas_1-1743516326255.png

 

variable : business_controller_approver reference to user table and auto populate based on this

suuriyas_0-1743516165190.png

in reporting unit table the vendor payment business controller is a list field 

name : 

vendor_business_controller

@suuriyas 

the field "vendor_business_controller" is list and referring to sys_user

Then it should work fine.

business_controller_approver -> variable refers to which table? within that table is the field name "vendor_business_controller" correct

share variable config screenshot for business_controller_approver  and the field on this table which holds Approvers

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

HI @Ankur Bawiskar ,

 

Yes, the field vendor_business_controller is a list field and refers to user table and this field is present in reporting unit table.

business_controller_approver -> refers to user table in user table we don't have the field vendor_business_controller. This field is present in reporting unit table.

business_controller_approver

suuriyas_0-1743518255144.pngsuuriyas_1-1743518291709.png

Reporting unit

suuriyas_2-1743518418969.png

 

@suuriyas 

so it should show approver from variable "business_controller_approver" and the approver/user present in the field "vendor_business_controller" on reporting unit table

then do this, ensure you give the correct variable name for reporting unit

javascript:'sys_idIN' + current.variables.business_controller_approver.toString() + ',' + current.variables.reportingUnitVariable.vendor_business_controller.toString();

If my response helped please mark it correct and close the thread so that it benefits future readers.

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