How to specify the server value for email account creation for gmail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 01:37 AM
Hi Guru,
Hope this finds you well,
How to specify the server value for email account creation. I am using the gmail site for testing.
Kindly find the attached screen shot, highlighted the required field to update..
Thanks in advance for time & help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 02:03 AM
Hi @NVSN ,
You will need to create a onchange client script like below to parse the email and push the domain name to the 'server' field.
function onChangeEmail() {
var email = g_form.getValue('email');
var domain = '';
if (email) {
var atIndex = email.indexOf('@');
if (atIndex !== -1) {
domain = email.substring(atIndex + 1);
}
}
g_form.setValue('u_server', domain);
}
I hope this helps.. you can also do this with array and split function...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 03:42 AM
Hi @NVSN ,
I tried your problem in my PDI and it works for me
Please check the below code this will work for you
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var email = newValue;
var server = email.indexOf('@');
var serverName = '';
serverName = email.substring(server + 1);
var onlyServerName = serverName.split('.')
alert(onlyServerName[0])
g_form.setValue('u_server', onlyServerName[0]);
}
Result
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 08:17 AM - edited 04-28-2024 08:39 AM
Hi @Community Alums ,
This is working for user table, but my concern is for email accounts.
Kindly check.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2024 09:52 AM
Hi @NVSN ,
By email account you mean that gmail na the domain name ?
You want that domain name in server field correct ?
Can you please provide me your code may be I'll fix that
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak