Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Populate the location based on country

Haresh Haru
Tera Expert

Hello @Sagar Pagar ,

 

I have requerement like in catalog item we have two fields called county and location both are referenced by cmn_location table so if i select country field as india then it show the only india based locations like bangalore, hyd ect ...

So can please help me on this ....

 

Regards

Haresh

1 ACCEPTED SOLUTION

Hi @Haresh Haru,

 

Make sure that the variables name are correct.

Both are referenced to the same table i.e. cmn_location. hence you need to query with country column.

 

javascript:if(current.variables.country_variable_name != ''){
"country=" + current.variables.country_variable_name.country;
}

 

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow

View solution in original post

6 REPLIES 6

Vishal Birajdar
Giga Sage

Hi @Haresh Haru 

 

Check if "Parent" is the common for specific location.

 

javascript: "parent=" + current.variables.country;

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

anshul_goyal
Mega Sage

Hi @Haresh Haru,

Use the Advanced reference qualifier below:

javascript: "country="+ current.variables.country.country;

Output:

Anshul21_0-1694073525423.png


Location Table filter condition:

Anshul21_1-1694073557337.png


If my answer solves your issue, please mark it as Helpful and Accepted.

Thanks,
Anshul