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.

Need to populate location field based on the country selection

rog
Giga Contributor

Hi all,

 

I have a requirement where in we need to populate the location (reference to cmn_location) value based on the selection of country (reference to core_country). If for example countries Japan and China are selected then on the locations that are active under these countries should be available for selection in location field.

 

I got to know that we need to achieve this through script include and advance reference qualifier since the location field is a reference field.

 

Could you please help me with the script, Im fairly new to scripting and would be a great learning for me.

 

Thanks in advance.

28 REPLIES 28

I have updated it to correct variable name. But still it is not working. 

It will be work only the field is a reference type. But you used the list 

Yes I it is a list collector. So how can we achieve this for list collector field type?

Hi,

Please see the below link, I believe it's too helpful for you:

https://community.servicenow.com/community?id=community_question&sys_id=47d98329db5cdbc01dcaf3231f96...

The requirement there was to pull the selected valuesin to description. Here my requirement is different from that.