Forum Discussion

DPapandria's avatar
DPapandria
Copper Contributor
Jan 16, 2019
Solved

Using Flow with SharePoint Library - file copy executed before file upload is complete

Trying to use Flow to move video files submitted to a "dead drop" folder into a controlled-access folder within a SharePoint Online document collection.   Essentially, a user drags a video file ont...
  • Matt Weston's avatar
    Jan 18, 2019

    Hi DPapandria

     

    The key indicator as to whether your file has uploaded or not is the file size. Until the upload is complete, the file size will be 0. As soon as it's complete you'll see the actual size. I tested this on a 400MB file.

     

    So I have shaped a Flow to look like the following:

     

    1. Trigger - When a file is created (properties only)
    2. Action - Initialise variable: Created a boolean called FileUploaded and a default value of false
    3. Control - Do until: FileUploaded = true
      1. Action - Get file metadata (this has to be done each time to ensure that we're looking at a fresh set of data
      2. Condition - If Size (from get file metadata) is not equal to 0
        1. If Yes: Set Variable "FileUploaded" to true
        2. If No: Delay for 10 seconds
    4. Action: Move File

     

    See my attached screenshot for an example.

     

    The thing to remember is that the loop will only run through 60 iterations, so ensure that you select your delay to give your file enough time to upload.

     

    Hope this helps.

Resources