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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
DebbieE
Community Champion
Community Champion

Copying a Json to another folder as Json. the specified path does not exist

I have a JSON file in a container project. then newdata. then projecta. then a dated folder 20240102 and then the file 2024010210100000.json

 

and I want to move it to the folder completed. I want it to create the projecta and the dated folder if they arent already created.

 

I tried preserve hierarchy but Im still getting

 

FileSystem: 'project'. Path: 'completed/projecta/20231007/2024010210100000.json'. ErrorCode: 'PathNotFound'. Message: 'The specified path does not exist.'

 

I have the copy set up like this:

Source

json data set with paramters rootFolder, filePath and fileName

And I coded in 

rootFolder project

filePath newdata/apc/20231007/ (I use a parameter to set this so I can dynamically add the correct dated folder)

fileName 2024010210100000.json (again added dynamically so it can get the correct file)

 

Sink

json data set with paramters rootFolder, filePath and fileName

And I coded in 

rootFolder project

filePath completed/apc/20231007/ (I use a parameter to set this so I can add the correct dated folder)

fileName 2024010210100000.json (again added dynamically so it can get the correct file)

 

And this isnt working because I only have completed

I thought it would just create the folder structure as it goes along. So a new day and when we copy across it would just create the folders.

 

can any one help me figure this out? I thought this would be a fairly simple one to do

1 REPLY 1
v-jingzhan-msft
Community Support
Community Support

Hi @DebbieE 

 

I made a simple test like below. I created "completed" folder in advance. Then when I ran the pipeline for the first time, it created the sub directory "apc/20231007" and saved the file in this destination folder successfully. So it supports creating a directory when the directory doesn't exist. 

vjingzhanmsft_0-1728873968704.png

 

For the 'PathNotFound' error, you may open the input of the failed activity, check whether the source and sink folder path and file names have correct values which are passed from the parameters. 

vjingzhanmsft_1-1728874802033.png

 

Additionally, for the current copy data activity, does it intend to copy a single file or a list of files? 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.