How to use the Variable of List Collector within Reference Qualifiere?

Martin Fallant
Tera Contributor

We want to use the variable of a List Collector within a Reference Qualifier.

We can work totally fine with Lookup select Box, but it doesnt work with variable type ListCollector.

Is there maybe a workaround? TWe want to offer one field with teh option to select several records and we want to offer a second field which relates only to the first selected.

 

Example

Variable 1  - Look up Select Box --> only one value can be chosen "Data1"

Variable 2 - Look up Select Box

Reference Qualifier: 

javascript:"column=" + current.variables.<var_name>.toString().split(',')[0]

 

works!

 

Example

Variable 1  - List Collector --> several values can be chosen "Data1,Data2,Data3"

Variable 2 - Look up Select Box

Reference Qualifier: 

javascript:"column=" + current.variables.<var_name>.toString().split(',')[0]

 

doesn´t work 😕 

 

we can get the data from ListCollector within Record producer Script after the Submit was made.

var <var_script>=producer.<var_name>.getDisplayValue().split(',');

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

update as this -> use IN instead of =

javascript:"columnIN" + current.variables.<var_name>.toString().split(',')[0]

Also ensure the variable attributes for list collector has this

ref_qual_elements=<var_name>

Regards
Ankur

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

update as this -> use IN instead of =

javascript:"columnIN" + current.variables.<var_name>.toString().split(',')[0]

Also ensure the variable attributes for list collector has this

ref_qual_elements=<var_name>

Regards
Ankur

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

Hello Ankur Bawiskar,

thank you for your assistance, i misunderstood that i get the sys_id´s of a specific record with the List collector.

 

Works now 🙂

 

BW

Martin

 

@Martin Fallant 

Did you marked your own response as correct?

Would you mind marking my response as correct if my comment worked for you.

Regards
Ankur

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