Padding an ID in workflow

2DF-MSD

03-05-2018

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!

Accepted Solutions (1)

Accepted Solutions (1)

Vapsy

Employee

03-05-2018

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

Answers (0)