Auto Populate Name based of another field selection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 11:20 AM
Hello,
I have a field name Business Unit with 3 choices (HQ, IET, OFSE). I would like the Leader field to auto populate a name based of the selection. For example,
If HQ is selected John Doe should be the name that's populated on the Leader field without the user being able to edit the field.
If IET is selected Kate Smith is the name that should be displayed/populated on the leader field without the user being able to edit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 11:26 AM
You can try Data lookup definition
Please mark my answer correct and helpful if this works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 10:39 PM
@karlab wrote:Hello,
I have a field name Business Unit with 3 choices (HQ, IET, OFSE). I would like the Leader field to auto populate a name based of the selection. For example,
If HQ is selected John Doe should be the name that's populated on the Leader field without the user being able to edit the field.
If IET is selected Kate Smith is the name that should be displayed/populated on the leader field without the user being able to edit.
To accomplish this, you will need to use a combination of field dependencies and read-only settings. The specific steps can vary depending on the platform or tool you're using (such as Salesforce, Microsoft Dynamics, or a custom web application)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 02:29 AM - edited 04-10-2025 02:09 AM
You can use a script in the Virtual Agent topic flow to fetch the required name based on the selected field. A script action or a data lookup in the topic can help pull the correct value dynamically. If you've worked on converting an Excel spreadsheet to web app, the approach is similar—extracting and displaying data based on user input. A simple GlideRecord query should do the trick.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 05:00 AM
To automatically fill the Leader field based on the selected Business Unit and make it read-only, create an onChange Client Script for the Business Unit field.
In the script, check the selected value and set the Leader field accordingly.
For example, if HQ is selected, set the Leader field to John Doe; if IET is selected, set it to Kate Smith. After setting the value, use g_form.setReadOnly('leader', true); to prevent users from editing it. Save the script and test it on your form to ensure the Leader field updates correctly when the Business Unit changes.