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
SFDC New learnerSFDC New learner 

Error:The formula expression is invalid: Formula result is data type (Text), incompatible with expected data type (Number).

Hi All,

I have created the field of type number and trying to update the field with leading zeros if the number of digits is less than 10. I am updating the field using flow, but getting the following error.
"The formula expression is invalid: Formula result is data type (Text), incompatible with expected data type (Number)."

LPAD( TEXT({!$Record.Individual_Number__c}) ,10,'0')
I don't see the above error if I give VALUE() function. But it didn't work as I expected.
Please Suggest.
Thanks,
AnkaiahAnkaiah (Salesforce Developers) 
Hi,

You were returning the text data type instead of number.

try with below.
LPAD( {VALUE(TEXT(!$Record.Individual_Number__c})),10,'0')

If this helps, Please mark it as best answer.

Thanks!!
SFDC New learnerSFDC New learner
Hi Ankaiah,

Thanks for the reply. But the issue is still there when I tried your code and  LPAD() expects text.

Please see the below error: 

The formula expression is invalid: Incorrect parameter type for function 'LPAD()'. Expected Text, received Number