Last name ,first letter autopopulate
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 05:13 AM
I have created a variable - name
And another variable- last name
So whenever the user enters last name(ex-john) then first letter "j" should populate in name field.
Require client script for this.
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 08:46 AM
@User_267 Here is the script you should use.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var lastName = g_form.getValue('last_name');
if(lastName!='')
g_form.setValue('name',lastName[0]);//First letter of last name
}
Tested on my PDI and it produces the intended result.