Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Padding an ID in workflow

2DF-MSD
Level 1
Level 1

Hi,

I have a workflow that I am running in campaign that is reading values from a file and putting them in a temp table. The data I am reading has a customer ID, is there a way to pad this customer ID with zeros within the workflow? Like running a javascript, or what will be the best way to achieve this?

Thanks!

1 Accepted Solution
Vapsy
Correct answer by
Employee
Employee

Hi 2DF-MSD,

You can certainly achieve that with the help of an enrichment activity on a workflow.

You can use the formula

LPad(<‘attribute that needs padding’>, <Number of characters in the final string after padding is applied>, <‘Character to use for padding at the BEGINNING if input text is smaller in length as compared to final output you want’>)

Or use

RPad(<‘attribute that needs padding’>, <Number of characters in the final string after padding is applied>, <‘Character to use for padding at the END if input text is smaller in length as compared to final output you want’>)

So in my test workflow I used

  • LPad([target/@account], 10, '0')
  • RPad([target/@account], 10, '0')

1479433_pastedImage_4.png

And here is the output

1479437_pastedImage_5.png

Regards,
Vipul

View solution in original post

1 Reply
Vapsy
Correct answer by
Employee
Employee

Hi 2DF-MSD,

You can certainly achieve that with the help of an enrichment activity on a workflow.

You can use the formula

LPad(<‘attribute that needs padding’>, <Number of characters in the final string after padding is applied>, <‘Character to use for padding at the BEGINNING if input text is smaller in length as compared to final output you want’>)

Or use

RPad(<‘attribute that needs padding’>, <Number of characters in the final string after padding is applied>, <‘Character to use for padding at the END if input text is smaller in length as compared to final output you want’>)

So in my test workflow I used

  • LPad([target/@account], 10, '0')
  • RPad([target/@account], 10, '0')

1479433_pastedImage_4.png

And here is the output

1479437_pastedImage_5.png

Regards,
Vipul

View solution in original post