function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dev2014dev2014 

formula to map numbers between fields

Hi,
 I used the formula below to get the first 4 digit of the credit card number field  but formula field remained  blank and was not updated once i entered the credit card number..
Formula:IF(NOT(ISBLANK(credit_card_number__c)), '', LEFT(credit_card_number__c, 4))

What is the correct syntax to implement this so it works  ?
Thanks,

Ben 
 
pconpcon
The LEFT function handles null values perfectly fine.  You can just do
 
LEFT(Credit_card_number__c, 4)

Salesforce will still return null if your formula just has an empty string in it.