0

There´s a lot of work to do with this formula, but to start with:

IF ( INCLUDES ( Email_Failed_Formats__c , "firstname.lastname" ), "FirstName.LastName; ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "firstinitial.lastname" ), "LEFT(FirstName__c, 1).LastName; ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "firstname.lastinitial" ), "FirstName.LEFT(LastName__c, 1); ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "firstnamelastinitial" ), "FirstNameLEFT(LastName__c, 1); ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "firstinitiallastname" ), "LEFT(FirstName__c, 1)LastName; ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "firstnamelastname" ), "FirstNameLastName; ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "firstname_lastname" ), "FirstName_LastName; ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "lastnamefirstinitial" ), "LastName.LEFT(FirstName__c, 1); ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "lastname.firstinitial" ), "LastName.LEFT(FirstName__c, 1); ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "firstname" ), "FirstName; ",null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "lastname" ), "LastName; ",null )

It isn´t returning the name of the contact in any of these formats, despite the fields being correct.

I'm hoping to show the name of the contact in a format that depends on what is chosen in the multi-select picklist.

For instance, if "firstname.lastname" is chosen in the multi-select picklist, that should result in "John.Smith" appearing in the formula text field. If "firstinitial.lastname" is chosen, that should result in "J.Smith". And so on...

Part of the problem seems to be the spacing between the"FirstName" and "LastName" fields, but the method suggested below results in a syntax error (Found 'LastName').

2 Answers 2

0

I believe the syntax you're looking for would be:

IF ( INCLUDES ( Email_Failed_Formats__c , "firstname.lastname" ), FirstName+"."+LastName; ,null )
5
  • Thanks, but this results in a syntax error (Found 'LastName')...any ideas?
    – user34868
    Commented Aug 15, 2016 at 12:36
  • 2
    Concatenation operator is &, not +.
    – Adrian Larson
    Commented Aug 15, 2016 at 13:35
  • I tried & as well: IF ( INCLUDES ( Email_Failed_Formats__c , "firstname.lastname" ), FirstName &' . '& LastName; ,null
    – user34868
    Commented Aug 15, 2016 at 13:37
  • 2
    @ESil IF ( INCLUDES ( Email_Failed_Formats‌​__c , "firstname.lastname" ), FirstName & '.' & LastName, null)
    – cropredy
    Commented Aug 15, 2016 at 15:22
  • Thanks @AdrianLarson and cropredy. Can you tell I don't write a lot of workflow rules? ;) Thanks for helping him get to the finish line guys. :)
    – crmprogdev
    Commented Aug 15, 2016 at 20:27
0

Here´s what I got to work, in the end, thanks to @cropredy, @Adrian Larson and @crmprogdev.

IF ( INCLUDES (  Email_Failed_Formats__c , "firstname.lastname" ), FirstName & '.' & LastName, null) & 
IF ( INCLUDES (  Email_Failed_Formats__c , "firstnamelastname" ), FirstName & '' & LastName, null ) & 
IF ( INCLUDES (  Email_Failed_Formats__c , "firstname_lastname" ), FirstName & '_' & LastName, null ) &  
IF ( INCLUDES (  Email_Failed_Formats__c , "firstname" ), FirstName, null ) & 
IF ( INCLUDES (  Email_Failed_Formats__c , "lastname" ), LastName, null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "lastnamefirstinitial" ), LastName & '' & LEFT(FirstName, 1), null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "lastname.firstinitial" ), LastName & '.' & LEFT(FirstName, 1), null ) &
IF ( INCLUDES ( Email_Failed_Formats__c , "firstinitial.lastname" ), LEFT(FirstName, 1) & '.' & LastName, null ) & 
IF ( INCLUDES ( Email_Failed_Formats__c , "firstname.lastinitial" ), FirstName & '.' & LEFT(LastName, 1), null ) & 
IF ( INCLUDES ( Email_Failed_Formats__c , "firstnamelastinitial" ), FirstName & '' & LEFT(LastName, 1), null ) & 
IF ( INCLUDES ( Email_Failed_Formats__c , "firstinitiallastname" ), LEFT(FirstName, 1) & '' & LastName, null )

You must log in to answer this question.