- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 10:51 AM
Dear Expert,
How can I proceed with this requirement? Once the user field name is entered, the email field should automatically populate. Please help Thank you so much. Appreciate your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:34 AM
did you try putting alerts ?
make sure your back end names of variables are correct
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var user = g_form.getReference('name', userDetails);
function userDetails(user) {
alert(user.email);
g_form.setValue('email', user.email);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:54 AM
No problem ! Have a good weekend
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 08:19 AM
this feature only worked on the AGENT side but on the customer portal it did not work??? Please HELP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:47 AM
@ND
You can do this without scripting using Catalog lookup definition
Create a catalog lookup definition
Catalog Data Lookup Definition on any table, eliminating Catalog Client Scripting
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:53 AM
Thank you Ankur, I will try this Catalog lookup for sure. BEST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 03:25 PM
We solved for this using a business rule. This rule updates the email address automatically any time the username field changes. I'm just guessing at the field names, but this should give you an idea.
When to Run: "UserName" Changes and the "UserName" is not empty.
Insert = True , Update = True
Actions: Set field values "EmailAddress" "Same as" "UserName.EmailAddress"