cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JeroenKrah
Regular Visitor

Copy a single file from FTP to Google Drive

I need to watch a folder on an FTP server. I use the trigger and pass it on to create a file on Google drive.

Then every file that is created or changed on the folder is copied over. I don't need them and it is not compliant.

Only one file I need to watch (it is updated every 5 hours) and it is not an option to put that file in a single folder.

So, I used the Condition and put in the CASE = yes the filename that I want. Next is adding the file to the Google drive. But all the files, including the wanted file are ending up in the CASE = no box. 

Any suggestions? 

1 ACCEPTED SOLUTION

Accepted Solutions
AlanPs1
Resident Rockstar
Resident Rockstar

Hi @JeroenKrah, thank you for posting this.

 

If I am understanding correctly you say "So, I used the Condition and put in the CASE = yes the filename that I want. Next is adding the file to the Google drive. But all the files, including the wanted file are ending up in the CASE = no box."

 

I am understanding that you only want the one file that updates every 5 hours to move to google drive, not the rest?

 

I have had a look and have created a condition that will get just 1 file from the FTP folder.

 

Here is an explation firstly as to why it has been handles in the way:Capture-251.png

FTP returns the file name in base 64 format, so it needs converting before the real file name will match.

Please see below on how I have done this:

Capture-253.png

You will see below the new output of the file when I have used base64ToString() to convert the file name.Capture-254.png

 Without the conversion, any condition you will write will try and match "ZmlsZTEyMTM0NTYucGRm" (in my example) as the file name.

 

With the above set up just one file is targetetd and it moves to google drive. I am not sure how Google drive will handle overwriting the file, in my testiong it errored if file name existed already but at least now you can maybe write a condition that is more likely to match on file name.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

5 REPLIES 5
AlanPs1
Resident Rockstar
Resident Rockstar

Hi @JeroenKrah, thank you for posting this.

 

If I am understanding correctly you say "So, I used the Condition and put in the CASE = yes the filename that I want. Next is adding the file to the Google drive. But all the files, including the wanted file are ending up in the CASE = no box."

 

I am understanding that you only want the one file that updates every 5 hours to move to google drive, not the rest?

 

I have had a look and have created a condition that will get just 1 file from the FTP folder.

 

Here is an explation firstly as to why it has been handles in the way:Capture-251.png

FTP returns the file name in base 64 format, so it needs converting before the real file name will match.

Please see below on how I have done this:

Capture-253.png

You will see below the new output of the file when I have used base64ToString() to convert the file name.Capture-254.png

 Without the conversion, any condition you will write will try and match "ZmlsZTEyMTM0NTYucGRm" (in my example) as the file name.

 

With the above set up just one file is targetetd and it moves to google drive. I am not sure how Google drive will handle overwriting the file, in my testiong it errored if file name existed already but at least now you can maybe write a condition that is more likely to match on file name.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

v-yuazh-msft
Community Support
Community Support

Hi @JeroenKrah,

 

I agree with @AlanPs1's solution for encoding the file name.

Have problem been solved?

If yes, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

If no, please feel free to ask for help here.

 

Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi Alan,

Thank you for this! You are correct in your assumtion.

I will work and implement it.

Strange that it is not built in the flow itself.

On my Google Drive I have a sheet that imports the csv file (with SheetIE addon) and then deletes the file. So, no issues with the existing file (I had the error as well). Interesting is that GD can also host multiple files with the same filename. In the windows synch folder the have a number added (filename(2).csv, filename(3).csv, etc..) 

I let you know.

 

Jeroen

JeroenKrah
Regular Visitor

Hi Alan,

 

I get an error on the condition box. It tells me that the (I need to translate it from Dutch) template expression can not be processed because the function outputs is not defined or valid. I tried to use the Dutch translation for outputs which is 'uitvoer' but that gave the same error. The filename in question is called Reporting_Entry.csv.

 

error2.jpg

error1.jpg

error3.jpg

 

 

 

As you can see, I am also not getting 'outputs' as a function in the list.

 

Jeroen

 

 

Hi Alan,

I figured it out, and it works. I left in the expression 'Compose_File_Name', which is of course the name of the action as you named it. So, I changed it in the name of my action and that did the trick.

Thanks so much for your help.

 

Jeroen

 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (41,128)