Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
arkiboys
Advocate II
Advocate II

copy .csv data to warehouse

hello,

using the copy activity in fabric I can take data from .csv file (Which is sitting in azure storage account) and place the data into the table in the warehouse (tblwh) - I am using mapping in the copy activity. all good so far.

Now I have added a few more columns into the tblwh. These new columns are not in the source .csv file.

For example, I have added a new column called presentdate, filepath, fileextension, fullfilepath

Question:

How is it possible I populate these extra columns in the tblwh because the mapping tab in copy activity does not obviously have any source columns for these ?

thanks

1 ACCEPTED SOLUTION

Hi @arkiboys ,

I can also find the same result -

vgchennamsft_0-1715334131528.png


By default FileName and FilePath are designed like that.
As a workaround (assume file path won't change dynamically), you can use custom value -

vgchennamsft_1-1715334211597.png

 

Hope this is helpful. Please let me know incase of further queries.

View solution in original post

7 REPLIES 7
v-gchenna-msft
Community Support
Community Support

Hi @arkiboys ,

Thanks for using Fabric Community.
You can add your additional columns in Copy Activity from here - 

vgchennamsft_0-1715332009897.png

 

Eg:

vgchennamsft_4-1715332747762.png

 



After adding additional columns in source can you please click on import schema in mapping?

vgchennamsft_0-1715331719131.png

Eg:

vgchennamsft_3-1715332730473.png

 


After importing you can run the pipeline

Hope this helps.

this is good. thanks

in source copy tab, I use

filename --> $$FILENAME which gives 'some-03-May-2024.csv' --> this is correct

 

directory_path --> $$FILEPATH but this gives the fullpath such as 'Data/some-new/some-03-May-2024.csv'

whereas I would like to see the directory such as 'Data/some-new'

thanks

Hi @arkiboys ,

I can also find the same result -

vgchennamsft_0-1715334131528.png


By default FileName and FilePath are designed like that.
As a workaround (assume file path won't change dynamically), you can use custom value -

vgchennamsft_1-1715334211597.png

 

Hope this is helpful. Please let me know incase of further queries.

thank you

Hi @arkiboys ,

Glad to know that your query got resolved. Please continue using Fabric Community on your further queries.

hi, I see you have hardcoded the value however my pipeline I would like it to be dynamic as the path will vary since the source varies

any suggestions?

thanks

Hi @arkiboys ,

Can you please share the screenshot of Copy Activity - Source?
I would like to see how are defining file path dynamically? So that I can help you.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayFBCUpdateCarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.