Skip to main content

Is there a way to pad text in order to make it a fixed length? For instance, I have a string of numbers that can be anywhere from one to five characters. If the string only has one character, I would like to add four zeros to the left of the string for a total length of five characters.  I'm new to this platform so any assistance is greatly appreciated. 

Yes, absolutely. Here are the steps to pad text to make it to a fixed length.

  1. Get the length of the string using the action: String → Length
  2. Loop while the length of the string is less than 5.
  3. Add 0 to your string using the action String → Assign
  4. Get the length of the string again (within the loop) to check if it has reached 5 in the next iteration.

Attached a sample automation for your reference.

Hope this helps, let me know.


Thank you very much Arjun! I was hoping there might be an action for this. I appreciate your help.


Reply