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.

Filter Certifications Based on Selected Multiple Skills (List Collector to List Collector)

SujanD345956992
Tera Contributor

Hi Community,

I need help implementing dynamic filtering between two list collector fields in a custom table form.

Here’s my setup:

Skill Table

  • Stores the list of available skills (e.g., Java, Python, AWS)

Certification Table
Contains the following fields:

  1. Certificate Name – Type: String

  2. Skill – Type: Reference (to Skill Table)
    → This field links each certification to a specific skill.

Main Table (Where form logic is applied)
Has these two fields:

  1. Skills – Type: List Collector (Reference to Skill Table)

  2. Certifications – Type: List Collector (Reference to Certification Table)

Goal:
When I select one or more skills in the Skills field (list collector), I want the Certifications field (list collector) to show only those certifications that are linked to the selected skills.

Example:

  • If I select “Java” and “Python” as skills,

  • Then the Certifications field should only display certifications where the Skill field in the Certification Table matches either "Java" or "Python".

What I’ve Done:

  • The relationships are correctly set up.

  • I can filter certifications based on a single skill using a Dynamic Reference Qualifier.

  • But now I want to support multiple skills (list collector) and update the certifications list dynamically based on all selected skills.

Any help with the correct Reference Qualifier script, Client Script, or a simple working example would be greatly appreciated.

4 REPLIES 4

J Siva
Kilo Patron
Kilo Patron

Hi @SujanD345956992 
I'm assuming that in your ref qualifier currently you are using somehting like "skill="+skill_field_value.
Instead of "=", try the below,
"SkillIN"+skill_field_value

 

Share your exisitng ref qulaifier configuration.
Regards,
Siva

Hey  @J Siva  Thanks for your time.
This is the Dynamic reference qualifier script i am using when the skills field is of type list collector and certifications of type reference:- 
(function getQualification(current) {
if (!current.skills) {
return '';
}
return 'skill=' + current.skills;
})(current);


But the problem is, I cant use the dynamic reference qualifier for list collector ----> list collector, i.e., Skills of type List collector to Certifications of type list collector. 

 

Additionally I also tried using client scripts. I 'll mention them below:- 

 

Reference Qualifier------> Advanced

Placeholder------->skill=javascript:current.skills

Client Script:-  

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) return;

// Get selected skills (array of sys_ids)
var selectedSkills = g_form.getValue('skills'); // comma-separated sys_ids
if (!selectedSkills) {
g_form.clearOptions('certification');
return;
}

// Construct filter: skill IN skill1,skill2,...
var filter = 'skillIN' + selectedSkills;

// Set filter dynamically
g_form.setReferenceQual('certification', filter);

// Optional: clear previous selections
g_form.clearValue('certification');
}

 

I hope you get this well.

J Siva
Kilo Patron
Kilo Patron

@SujanD345956992 

Is there specific reason for not using advanced ref qualifier?

The client script I mentioned above is not properly calling the advanced reference qualifier function.

That's the problem.