Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Concatenating the initials of names from last, first and middle initials from one field name.

Avatar

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
lpianwi
Level 2

29-05-2013

Hi All,

Good day. Please I am having problem writing script to cocatenate the first letter of the last name, first letter of the first name, and the middle initial from a name field.

Is there an example I can use.

Thanks

v/r

Tammy

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 3
Vjay_Reddy
Level 3

Likes

19 likes

Total Posts

139 posts

Correct Reply

14 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 3
Vjay_Reddy
Level 3

Likes

19 likes

Total Posts

139 posts

Correct Reply

14 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
Vjay_Reddy
Level 3

30-05-2013

Tammy,

Could you please give one Rater- Name example?

I assumed the Rater - Name is "Mathew Easow Jacob"

Try below script on Rater-initial Field.

var names = Rater_Name.rawValue.split(" ");

var initials="";

for(i = 0; i<names.length; i++ ){

          initials = initials +names[i].charAt(0);

     }

this.rawValue = initials;

Below is the Screenshot.

Untitled.png

Let me know if you need some more information.

Vjay

Answers (4)

Answers (4)

Avatar

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
lpianwi
Level 2

30-05-2013

Thanks a lot Vjay, you saved my day!

Avatar

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
lpianwi
Level 2

30-05-2013

Hi All,

I wrote the following script to see if it will extract the first character of the Lastname  in Rater-Name.

var psny=xfa[0].form[0].form1[0].page1[0].Rater_Name[0].rawValue;

form1[0].Page1[0].RaterInitial[0].rawValue=Substr(psny, 1, 1 );

It actually extract the first character of the input, however, I do not know how to add the search for the next words which will be the first name, and middle name, and also add to the code for it to rextract their first characters.

I need help with this.

Thanks

v/r

Tammy

Avatar

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
lpianwi
Level 2

Like

1 like

Total Posts

69 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
lpianwi
Level 2

30-05-2013

Vjay,

Good morning, and thank you for the code. It is not working right.

Are you assuming that there are 3 different fields called Lastname, Firstname, and Middlename?

There is only one field called Rater_Name, which should have a last name, first name, and middle name entered into it. This Rater_Name entered should concatenate into an initial field called RaterInitial.

I was thinking that since there are no distinct fields, that a script that will concatenate the first character of any words entered into the Rater_Name field after any space or comma could work, but I do not know how the script will look like.

Thanks

v/r

Tammy

Avatar

Avatar
Boost 5
Level 3
Vjay_Reddy
Level 3

Likes

19 likes

Total Posts

139 posts

Correct Reply

14 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 3
Vjay_Reddy
Level 3

Likes

19 likes

Total Posts

139 posts

Correct Reply

14 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
Vjay_Reddy
Level 3

30-05-2013

Hi Tammy,

Keep below script on the result field where you wanted to get First Char of (First and Last Name) and Middile Initial from Name.

Language - JS and Event - Calculate.

// Last.rawValue.charAt(0)      -      gets first char of the last Name

// First.rawValue.charAt(0)      -      gets first char of the First Name

// Middle.rawValue.charAt(Middle.rawValue.search(" ")+1)      -      gets Middle Initial of the Name.

this.rawValue = Last.rawValue.charAt(0) + First.rawValue.charAt(0) + Middle.rawValue.charAt(Middle.rawValue.search(" ")+1);

Example

     First Name : Mathew, Last Name : Jacob, Name: Mathew Easow Jacob

     Result will be : JME

Let me know if this helps ..

Vjay