Description: The lpad() function left pads a text string to the length desired. If the String input is a null value, the formula will return “”.

Syntax:
lpad(String, Length, Padding)

WHERE
  • lpad, in lowercase initiates the function
  • String is a single (not an array) Text element
  • Length is the desired number of characters
  • Padding is the text used to pad the String

Things to keep in mind when constructing this function:

  1. The key element of the function is case sensitive and must be entered in all lower case
  2. The String element is required
  3. The Length element is required
  4. The Padding element is required and must be text
  5. If the Padding is “” the result will be “”
  6. If the Padding is “ “ the result will be the String with no padding
  7. The result of the formula is a string
  8. You will receive an error in the formula if the input is not a Text element

Syntax Examples:
lpad(“Nioxus is great!”, 20 “*” ) = “**Nioxus is great!”

Real World Solution:
Sometimes you want a field in each record to have exactly the same number of characters. Just use the lpad() function and you’ll get exactly what you want. Say you have a Category field that you’d like to pad to 15 characters.

Here’s the code:

lpad(Category, 15, “” )

The result would look like this:

Revision: 2
Last modified: 2019/11/03

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Please do not use this for support questions.
For customer support, please contact us here.

Post Comment