Taking Cmn_loaction Reference for four fields Country, City, State, Address

VikramM1
Tera Contributor

Hi,

 

I have created four fields for all Country, City, State, Address and Taking Cmn_loaction Reference for all four fields.

 

When i select country: only country should be displayed.

When i select State: based on the country selected state should be displayed.

When i select City: Based on country and state selected. City should display.

 When i select Adress: Based on country and state and city selected. address should display.

 

But, all are showing only address.

 

How to acheive this in service now table form. Can someone help me on this?

13 REPLIES 13

Can you please specify what i need to mention in Type and parent [Type] = Address AND [Parent] = javascript:current.getValue('city')

Deborah Brown L
Kilo Sage

Hi @VikramM1 ,

 

you can refer Incident table, category and subcategory as an example.

Subcategory is a dependent field of category.

  • Open subcategory of the incident and can see that "use dependent field" is checked and "dependent on field" is "category".

DeborahBrownL_0-1712039926929.png

 

  • Now open any choice and you can see the field "dependent value" and we need to provide the value of the category to which this option should display.

DeborahBrownL_1-1712039956012.png

 

Use this as an example and finish your requirement.

 

Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me.

Regards,
Deborah Brown

kkrushkov
Mega Sage

Hello @VikramM1

Hope you are feeling good. 

You can try adding the following advanced reference qualifiers:

 

State: (current case it is called u_state_country)

javascript: current.u_country ? 'country=' + current.u_country.country : '';

 

City: (current case it is called u_city)

javascript: current.u_state_country && current.u_country ? 'country=' + current.u_country.country+ '^state=' + current.u_state_country.state : '';

 

Address: (current case it is called u_address)

javascript: current.u_state_country && current.u_country && current.u_city ? 'country=' + current.u_country.country+ '^state=' + current.u_state_country.state + '^city=' + current.u_city.city: '';

 

This way it will filter it the way you want it. 

 

If your purpose is to display only the names for each field without additional information (as in the picture), I will work on it and send you the response as soon as I am ready.

kkrushkov_0-1712068252240.png

 

 

 

Hi kkrushkov,

 

Any update on the this.

VikramM1_0-1712118562805.png

 

@VikramM1

Based on my research and efforts, this appears to be the closest way for achieving your intended purpose.

 

kkrushkov_0-1712122640348.png

 

But it will still show it like this:

kkrushkov_1-1712122692957.png

 

since this is the display value configured in the dictionary table.

kkrushkov_2-1712122712845.png

 

You can check this for reference: 

Solved: How to set the Custom list view for reference fiel... - ServiceNow Community