Hiding options in a list collector

Red
Giga Expert

How can you hide certain options in a list collector depending on the "read" setting for a variable?

1 ACCEPTED SOLUTION

Red
Giga Expert

I was able to do this using onChange of the field that will be used to do a query on what to show in the list collector field.

It's a bit of a process but it's the solution to my requirement.

But thanks to all those who responded to my post.

View solution in original post

11 REPLIES 11

Hi, I am going to use a list collector and the options will come from the question choice table. I want to be able to hide options in my list collector depending on the role of the user. How can I achieve this? 

Hi,

I don't think addOption() or removeOption() would work on list collector with choice values.

you can try to use reference qualifier if that helps.

Regards
Ankur

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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

not possible to hide few records from list variable which refers to certain table

you can use query business rule to restrict the records or use advanced reference qualifier

Regards
Ankur

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

SJ10
Kilo Expert

Hi Red,

 

You can write an onLoad client script.

In that load role of user into a variable and if the user has that role, remove option from the lookup.

Ex: g_form.removeOption('state', '7');

Hope it helps.

Red
Giga Expert

I was able to do this using onChange of the field that will be used to do a query on what to show in the list collector field.

It's a bit of a process but it's the solution to my requirement.

But thanks to all those who responded to my post.