- Access your pipeline by heading over to the ADF interface and open up the pipeline that contains your Copy Data activity.
- Navigate to the 'Mapping' Section: Inside the Copy Data activity, you’ll find a tab labeled "Mapping." Click on this to view the current setup of how your source columns correspond to your destination columns.
- Locate the “Costcenter” column in the source columns list. Instead of a straightforward column-to-column mapping, we’re going to apply a transformation right here.
- Craft Your Expression: To ensure each “Costcenter” value has a total of 10 digits, we'll add leading zeroes where necessary. Use the following expression as a guide:
right(concat('0000000000', Costcenter), 10)
Here’s the breakdown: concat('0000000000', Costcenter) adds a series of zeroes in front of your “Costcenter” value. Then, right(..., 10) ensures that only the last 10 characters are taken, effectively giving you a 10-digit “Costcenter,” complete with leading zeroes.
Now that you've set up your transformation, do a quick check to ensure everything looks good, and hit 'Save.'
To make sure everything is working as expected, run your pipeline. You can do this either by uploading a new file (if your pipeline is triggered by event) or manually triggering it.
And there you have it! By following these steps, you can add leading zeroes to your “Costcenter” values right within the Copy Data activity, eliminating the need for a separate Mapping Data Flow. Keep in mind, though, for more intricate data manipulations, Mapping Data Flows in ADF offer a robust set of tools and functionalities.