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.

reference qualifier in a variable in a single row set, to reference another variable

aanchalsriv
Kilo Contributor

i need to set a reference qualifier on a vendor variable based on another reference variable, along with the condition that its active, how can i do that, both the variables are in different single row variable sets.

I am currently using the following reference qualifier
javascript: "u_type=Vendor^u_active=true^u_country="+current.variables.owning_branch_name.u_country.getDisplayValue();
help!!!!

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@aanchalsriv 

both variables are in different single row variable sets should not be an issue

this should work provided

1) you are using the correct u_type field and correct value Vendor to compare

2) you are comparing correct u_country field on that table and it's string type and the display value of country matches

javascript: "u_type=Vendor^u_active=true^u_country="+current.variables.owning_branch_name.u_country.getDisplayValue();

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

And what about if it is on the same single row because i cant reach the variable when its on the same 

javascript: "u_state=active^u_operation_type="+current.variables.u_area_affected_by_the_proceeding.u_operation_type

my ex would look like this and area affected is the internal name for the same single row variable set that my current variable need to filter

 

GopikaP
Mega Sage

Hi @aanchalsriv , yes it should work - owning_branch_name is the other single row variables' internal name, right? The syntax will be:

javascript: "u_type=Vendor^u_active=true^u_country="+current.variables.other_single_row_variable_internal_name.variable_name.getDisplayValue();
javascript: "u_type=Vendor^u_active=true^u_country="+current.variables.owning_branch_name.u_country.getDisplayValue();