- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 12:02 AM
Hi, is there any option to set default for field B based on Field A selection other than client script or data lookup. Both fields from same table. Example
Field A u_installation = Microduct, Casing, Plaster
Field B u_charge = Company, Customer
When user select Field A = Microduct or Casing, Field B will auto default to Company. If user select Field A = Plaster, Field B will auto default to Customer. User still able to see both choice list on Field B
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 12:48 AM - edited 10-02-2024 12:52 AM
Hello @Muhammad Arif B
Another way to achieve this requirement is by using a UI Policy to set the default value for the field. By configuring a UI Policy, you can update Field B based on the selection in Field A, allowing it to default to the desired value. This approach is straightforward and allows for easy modification, while still giving users the ability to manually change the value if needed.
If you found my answer useful, I'd appreciate it if you could like it and mark it as the accepted solution. This helps others locate the solution more easily and support the community!
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2024 01:30 AM
Hi @Muhammad Arif B,
You can set value using UI Policy also. If both are choice fields, then you can use Dependent value option for field B and dependent field for it would be field A. Then you can set the dependent choice values of field A in Dependent Value in dictionary of field B.
If you found my response helpful, please mark it as Solution and Helpful.
Thanks and Regards,
Ehab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 12:12 AM
Hi @Muhammad Arif B ,
You can use client script to fulfill this requirement, why you need any other way for this?
If this solves your query, mark this as correct and helpful.
Thanks
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2024 01:13 AM
client script doesnt support on my mobile apps currently
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 12:23 AM
Hi @Muhammad Arif B
Create a On change Client script on field
if (newValue === 'Microduct' || newValue === 'Casing') {
g_form.setValue('field2', 'Company');
} else if (newValue === 'Plaster') {
g_form.setValue('field2', 'Customer');
}
Please mark this response as Correct and Helpful if it helps you can mark more that one reply as accepted solution
Thanks
Eshwar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 12:44 AM
Hi @Muhammad Arif B
You can try this
https://www.servicenow.com/community/developer-forum/dependent-choice-lists/m-p/1821197
"If you found my answer helpful, please give it a like and mark it as the accepted solution. It helps others find the solution more easily and supports the community!"
Thanks & Regards,
Barath.P