List collector validation and restrictions

Jake Adams
Tera Contributor

Hi Experts,

 

I have a list collector type variable that refers to the cmdb_ci. 

 

I have a custom choice field in the cmdb_ci which has choices let's say A,B,C and D.

 

If the user first select a CI in the list collector and the choice value of that CI is A then the next selections should be only of Choice A, if they select the presiding CI's related to any other choices then it must throw some kind of error or info message.

 

I also want to restrict the list collector selection to max 5 values.

 

Kindly assist on this.

 

 

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Jake Adams 

you will have to use onChange catalog client script for this.

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Jake Adams 

this would be tricky to handle as it's a list collector and it allows multiple selection.

What if user selects 2-3 CIs with different Choices like A, B and C

What will you do in this case?

To overcome this is the solution and will make your job and user's job easier

1) Have a reference variable to cmdb_ci

2) then have another list collector to cmdb_ci which allows them to select additional CIs and add this ref qualifier so that they select additional CIs based on 1st one

Advanced ref qualifier

javascript: 'sys_id!=' + current.variables.1stVariableName + '^choiceField=' + current.variables.1stVariableName.choiceField;

In variable attributes of list collector use this

ref_qual_elements=1stVariableName 

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

@Jake Adams 

Hope you are doing good.

Did my reply answer your question?

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

@Jake Adams 

Hope you are doing good.

Did my reply answer your question?

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