We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

client script for two choice type fields

GBS
Tera Contributor

I have two choice type fields named State and City in a table. If I select a state in the state field, only cities that belong to the selected state must be visible in the City field.

 

Can anyone help me with the client script.

7 REPLIES 7

vermaamit16
Kilo Patron

Hi @GBS 

 

From where you are getting the information for state and city? I am assuming that it is being fetched from a REST API response. If yes, you need to configure a script include to fetch the API response and pass it on the two fields via an On-Change client script on the state field. 

 

Thanks & Regards

Amit Verma

Thanks and Regards
Amit Verma

Dr Atul G- LNG
Tera Patron

Hi @GBS 

 

You can use same way the way we have assignment group and Assigned to.

LearnNGrowAtul_0-1702985872098.png

 

*************************************************************************************************************
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

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

GBS
Tera Contributor

both the fields are not reference type they are choice type 

Hi @GBS 

 

Make reference and your life will be easy in this case. The value in choices must not more than 8-10 , if you make City and state choices it is too much to maintain. 

*************************************************************************************************************
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

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