value changes based on the other field

Prati2
Tera Contributor

Hi Team,

I want have two fields on form one is choice field and other is the lit collector field, based on the choice i have selected in choice field the other field which has type as list collector should show the options. I have created on change client script to achieve this i can see script is entering into the condition, but it is not reflecting options for second field which has type list collector based on the option selected from 1st field whose type is choice field.

 

can anyone help me on this?

 

thank you

8 REPLIES 8

Well, to be able to list the options in a list collector you have to pass the sys_id of the choice, or choices, that you have in that list collector.

See if this content helps you:
https://www.servicenow.com/community/developer-blog/dynamically-set-list-collector-on-change-of-vari...

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

Anubhav24
Mega Sage
Mega Sage

Hi @Prati2 ,

 

I am working on a similar requirement as you are , please refer below post :

https://www.servicenow.com/community/developer-blog/dynamically-set-list-collector-on-change-of-vari...

 

Please mark helpful/correct if my response helped you.

Prati2
Tera Contributor

did not get this. do you have any other solution.

@Prati2  Basically list collector stores the sys_ids of the record , so to set values in a list collector variable you need to have the sys_ids of the record , you can not simply add a value to the list collector.