Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 18th, 2019, 09:47 AM
rrdwitt rrdwitt is offline
Regular Contributor
 
Join Date: May 2016
Location: Missouri
Posts: 53
Default Combine and reformat different cells

Hi All, I will try and explain this issue as best I can. We have a mail list.
With header names, "First name", "Last Name", but the customer only wants to use the "First name", UNLESS there is only a single letter. If there is only a single letter for the "First name" they want the "Last name" added.

Example: "First Name" "R." "Last name" "Johnson" how they want it to appear is "R. Johnson" But they do not want the "Last name" field on all the records. ONLY on the ones that have a single letter "First name".

Thanks!!!
Reply With Quote
  #2  
Old January 21st, 2019, 09:37 AM
merski007 merski007 is offline
Junior Community Member
 
Join Date: Jan 2014
Location: Milwaukee, WI
Posts: 24
Default Re: Combine and reformat different cells

Hello,

Maybe a rule like this would work:

var name= '';

if(firstName.length === 1){
name = firstName + '. ' + lastName;
// depending on the data, you might need to strip away any character that's not a letter, and then add the period to the string.
}
else{
name = firstName;
}

return name;
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.