How can I add leading zeroes to certain fields?

Looking for advice/insights:

Using Oracle Eloqua, I'm looking for a way to ADD a '0' to zip codes with 4 digital (US east coast zip codes), for example 2345 should be 02345


add leading zeros to an ID field where the total character count should be 15, however, sometimes the leading zeros are stripped and we're left with 123 or 12356, so we'd need 123 to be: 000000000000123 and 12356 should be: 000000000012356

I was poking around in Regex replacement in the data washing machine activity but I wasn't able to find anything definitive.

anybody have any insights on how to accomplish this? THANKS! 🍩


  • Piotr Sito
    Piotr Sito Posts: 45 Blue Ribbon
    edited Nov 25, 2022 12:29PM

    Hello @tenperk

    Using Contact Washing Machine cloud action step you can configure your action in the following way:

    Select your Source Eloqua contact field to cleanse: Zip Code

    Set Condition to RegEx ^....$ (start of string, any four characters, end of string) so you can capture all Zip Codes with 4 digits.

    Using Compose Action make sure to append 0 in front of the Zip Code 0${ZipCodeFieldName}

    Destination field: Zip Code

    Using the same logic you can update an ID field, for example:

    if ID RegEx ^.......$ (any 7 characters) then Compose 00000000${ID} (append 8 zeroes in front of an ID value).

    Hope this helps.

    If you have any other questions please let me know!

    Piotr Sito

    Senior Marketing Automation Specialist


    Post edited by Piotr Sito on