Add field to tree picker hierarchy

thomasawhit
Tera Contributor

On the User table, the Location field has a tree picker. I have two questions about this.

1. The hierarchy for this is Country -> State -> City. Where is this defined in ServiceNow? How does the tree know that this is the structure? I don't see any dependencies for these fields.

2. How do I add a field to this tree picker? Specifically, I want to add ZIP / Postal Code to the tree picker after City, making the hierarchy Country -> State -> City -> ZIP.

How can I accomplish this?

1 ACCEPTED SOLUTION

Swapna Abburi
Mega Sage
Mega Sage

Hi @thomasawhit 

"A hierarchical table is any table that has a parent field pointing back at itself.", for Example: If you see Parent field of locations. Location record Parent is mapped with City. City itself is another location record with Parent mapped as State and etc.

 

SwapnaAbburi_0-1740626465836.png

 

if you want to include zip code in the hierarchy, you need to create location records with name as Zip codes and parent of zip codes should be mapped to City location record. hope it helps.

View solution in original post

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @thomasawhit 

 

https://www.servicenow.com/docs/bundle/xanadu-platform-user-interface/page/use/common-ui-elements/co...

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0750703

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Swapna Abburi
Mega Sage
Mega Sage

Hi @thomasawhit 

"A hierarchical table is any table that has a parent field pointing back at itself.", for Example: If you see Parent field of locations. Location record Parent is mapped with City. City itself is another location record with Parent mapped as State and etc.

 

SwapnaAbburi_0-1740626465836.png

 

if you want to include zip code in the hierarchy, you need to create location records with name as Zip codes and parent of zip codes should be mapped to City location record. hope it helps.

Ankur Bawiskar
Tera Patron
Tera Patron

@thomasawhit 

that's coming from platform.

I don't think you can add your own logic there.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader