How to hide one field based on the user's Location?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 09:21 PM
Hi All,
I have a requirement that basically i have one record producer, in that i have one variable set, in that , three fields, "subject person, leave type and period", , so my requirement was that the field 'leave type' was only visible , when the users with location (WA or SA),
So please help me to achieve this
Thanks
Ramu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 09:44 PM
Hello @Ramu6 ,
Give me some clarity, in your question "when the users with location (WA or SA)", here users means the logged user or is there any requester field?
Thank you
G Ramana Murthy
ServiceNow Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 09:49 PM
Hi Ramana,
Thanks for the response
Actually there is one 'Subject person", its reference filed to user table only, so based on this we need to hide the other field
Thanks
Ramu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 10:24 PM
Hello you can write a catalog onchange client script on variable subject person
Client Script:
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 06:35 AM
Hi @Harish KM
thanks for the response and sorry for the delaying
I have tried this code but it always go to else part only , if we select any user it hides the field