question

ewinkiser avatar image
0 Votes"
ewinkiser asked SaurabhSharma-msft commented

When using a Copy Activity the output seems to take the leading zero off - Please help

Hi @nasreen-akter @MartinJaffer-MSFT @HimanshuSinha-MSFT
In a COPY Activity I am reading a JSON file which has as the first item is employeeid such as 010004.
Most of the employee id's begin with a ZERO. My issue is that when the Copy Sink is an Excel spreadsheet and the employee is copied without the leading zero, such as 10004. I think Copy this Spreadsheet into a DB Table. In the DB Table the employee id has NO leading zero.

How can I get the leading zero back into the COPY Output so that the employee id is 010004 and the ERP will recognize it?

Thanks!!
Mike

78521-image.png


azure-data-factory
image.png (92.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

nasreen-akter avatar image
0 Votes"
nasreen-akter answered SaurabhSharma-msft commented
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks @nasreen-akter , this Integration in this pipeline is fully automated; in that way, I need to add the leading zeros inside the pipeline some way. @Concat? what would you suggest?

Thanks so much!!
Mike Kiser

0 Votes 0 ·

@ewinkiser, in your pipeline, if you have CopyActivity to read JSON file and sink it into a CSV (in the CopyActivity--> Mapping--> Type on target side), you can select String Type which will keep the leading zero in the CSV file (you can see the leading zero by opening the csv file in a txt editor not in excel). Now if you read the csv file in any pipeline activity, the value should get with the leading 0. Please see the screenshots below. Thanks! :)

78831-img25.jpg
78730-img26.jpg


0 Votes 0 ·
img25.jpg (42.7 KiB)
img26.jpg (13.7 KiB)

@ewinkiser Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

0 Votes 0 ·
Show more comments