cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
memphis111
Helper I
Helper I

Problem with the Trigger "When a File is created"

Hello, everyone,

 

I have a problem with the trigger "When a file is created".
I would like to load a file from an FTP server, save it and then extract it

However, I have a problem with the trigger "When a file is created".
Screenshot of the FlOWS.
What am I doing wrong?

 

greetings

 

memphis111_0-1630075401521.png

 

5 REPLIES 5
eric-cheng
Solution Sage
Solution Sage

Hi @memphis111 ,

 

Triggers need to be the first action of a flow. Also, the trigger in the left branch you have added is a SharePoint trigger rather than sFTP.

 

Have a look at this post for pointers.

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Hello, sorry I don't quite understand that. where should I put the "When a file is created" trigger? Would like to download a file from an FTP server, then save it and then extract it.

If I set the trigger all the way to the front, it unfortunately runs into a timeout

 

memphis111
Helper I
Helper I

Hello,

I just tried it, but unfortunately I get the following error: { "status": 400, "message": "Unable to extract contents of file

memphis111_0-1630095092777.png

 

eric-cheng
Solution Sage
Solution Sage

Hi @memphis111 ,

 

Your flow should look something like the below.  I don't have a FTP server so only have sFTP.  The FTP connector may have differences but the main point is that the flow should be relatively simple like the below.

 

The below flow will get triggered whenever a file is added or modified on within a folder in my sFTP server.  It will then create the .zip file in a SharePoint library and then extract it.  

 

The formula I used is below which is used to get the decoded filename of the file.

 

@triggerOutputs()?['headers/x-ms-file-name']

 

ericcheng_0-1630153736843.png

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

memphis111
Helper I
Helper I

Hello, perfect, its worked, thank you very much.

Any question, when I start with the trigger, it runs 4 times in a row and therefore unfortunately creates all entries 4 times for me

 

memphis111_0-1630409181003.png

 

I've read that this can often happen when you start with the trigger and want to write values into a Sharepoint list, but unfortunately I don't know how to change that

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (1,837)