Pad transform function

Introduction

The pad transform function is used to pad an existing string of characters to a given length, using a given character. You can apply padding to the left (i.e. immediately before the existing string), to the right (i.e. immediately after the existing string), or both (immediately before and after, as equally as possible).

Example

The payload item below contains a string that's 8 characters long:

{"ref":"12345678"}

If we apply padding to a length of 20 using a * character to the right, the result would be:

{"ref":"12345678************"}

Here, we have an extra 12 * characters to the right, giving a string length of 20. However, if we apply the * character to both, the result would be:

{"ref":"******12345678******"}

Now the padding is applied with 6 characters to the left of the original string and 6 characters to the right.

Adding a round date transform

Step 1 In your process flow, access settings for your map shape:

Step 2 Select the add transform button for the required mapping rule - for example:

Step 3 Click the add transform button:

Step 4 Click in the name field to access a list of all available transform functions, then select pad from the string section:

Step 5 Click in the direction field and select where you would like padding to be applied:

You can apply padding to the left (i.e. immediately before the existing string), to the right (i.e. immediately after the existing string), or both (immediately before and after, as equally as possible).

Step 6 In the length field, specify the number of characters that you'd like the final (i.e. transformed) string to be - for example:

Step 7 In the pad character field, specify the character that you'd like to use for padding - for example:

If you want padding to be applied with spaces, press the space bar once in this field.

Step 8 Click the add field button:

Step 6 Click in source fields and select the source field to be used for this transform:

Step 7 Accept your changes (twice).

Step 8 Save the transform.

Last updated