- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2019 09:13 AM
Hello Guys,
I have a form, In this form I got 2 drop downs [ 'Department','Gender' ]
*Values in Department [ 'IT', 'FIN', 'COMM' ] & values in Gender [ 'M','F','T' ]
#what i want to do here is, >>> When i select "IT" value from Department, Gender drop down should automatically set its value to ' M '
I know that UI policy is only used when we need to make field [ mandatory, hide, read-only ], But is it possible to do this via UI policy advance script ?
Can SomeOne please help me here, show me how to write script to change the drop down value of Gender.
Thank You ....
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2019 09:20 AM
Hi there,
Indeed you can use the run scripts, execute if true:
function onCondition() {
g_form.setValue('gender', 'M');
}
Maybe slightly have to change, depending on the exact value names you have.
This of course + a normal condition on the Department field. Department is IT or something 🙂
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2019 09:20 AM
Hi there,
Indeed you can use the run scripts, execute if true:
function onCondition() {
g_form.setValue('gender', 'M');
}
Maybe slightly have to change, depending on the exact value names you have.
This of course + a normal condition on the Department field. Department is IT or something 🙂
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2019 09:41 AM
Hey Thanks a lot Mark, it worked.. 🙂