- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 11:07 PM
Hello Experts,
I need you help on below:
I have two reference variables which are list collector (i.e. it will select multiple values)
1. Country
2. Location
So whenever country A is selected then Location under country A must be visible
If country B is selected then country under B must be visible.
This variables are created under multi row variable.
Please help with onchange client script or if there is any other way to achieve it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 01:11 AM
Please use it as below correctly replace the country field name and variable name
If the country is a reference field on the location table use the below:-
javascript:'u_crm_salesforce=true^countryfieldnameonloacation='+current.countryvaribalename;
If the country is text field on location table use the below:-
javascript:'u_crm_salesforce=true^countryfieldnameonloacation='+current.countryvaribalename.getDisplayValue();
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 02:43 AM
Hello,
Assuming the country name is correct for field and variable use it as below:-
javascript:'u_crm_salesforce=true^country='+current.variables.country.getDisplayValue();
Please see the screenshot below:-
Please mark my answer as correct based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 02:53 AM - edited 11-08-2022 03:00 AM
Hope you are using list collector variable since I have this format
Also now properties list is appearing only for first selection of country. If I select country B then no location under country B is visible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 03:03 AM
It working fine with below Ref qualifier javascript:'u_crm_salesforce=true^countryIN'+current.variables.var_country.getDisplayValue();
Thank You for guiding. It was really helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2022 11:41 PM
Hi @Ankita Gupte ,
It is not possible through client script, you will have to use reference qualifier for this. Use the below link, it will help you achieve your requirement:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0746780
Regards,
Kamlesh