Forum Discussion

Marius_Mockert's avatar
Marius_Mockert
Copper Contributor
Mar 24, 2022

Difference between overwrite in browser and overwrite in PowerApps

Hi all,
I'm struggeling with one of my Flows at the moment.

 

Background: I have a Library were about 20 documents (automatically created PDF's with some charts) are saved in 5 different folders and shared (Everyone with the link). Each month the documents are "replaced/overwritten" with an updated copy of the file. For the past months we did this manually. So the updated files (with the same name like the files in the Library) were copied with drag & drop in the browser and clicking on "replace". During this copy process, the original files were overwritten, and the share-link stayed the same. So our customers were able to access the new file, via the "old" share-link. (you can also see the versioning of the file creating a new version)

Now I was trying to automate this process with a Flow. As document source I was trying to work with my personal OneDrive and also with a library on the same SharePoint site. Creating the Flow wasn't a big deal, but the Flow did something I did not expect. Instead of replacing the file - like it does with drag&drop - the flow replaced the original file as version 1.0 and the before created share-link stopped working.

I tried several different copy-processes, here are some examples:

 

- SP:GetFileContent -> SP:CreateFile (in temp library) -> SP:MoveFile (to destination library and replace)

- SP:GetFileContent -> SP:CreateFile (in temp library) -> SP:CopyFile (to destination library and replace)

- OD:GetFileContent -> OD:CreateFile (in OD Subfolder) -> OD:CopyFileToURL (to destination library and replace)

- PowerShell commands to upload files to a library

- SP:HTTPRequest (getfilebyserverrelativeurl + replace)

 

But it was always the same result... the original file was replaced and seemed like a completely new file instead of "attaching it as a new version".

 

Does anyone know how to achieve this, or if it is possible? Or perhaps the is an alternative solution to update files (PDF) and keep their created share-link?

 

Thanks in advance

Marius

  • Micca0815's avatar
    Micca0815
    Apr 01, 2022

    Marius_Mockert 

    Professionals might have to duty their profession 😉

    You could simply use 'get content using path' if your locations are this static and then perform an 'update file' action providing the content of it on your target file.
    This way a new version is created and any sharing link remains functional.

    Given that you might need to stick on the 'create file' action instead ensure the option 'Allow chunking'  below 'Content Transfer' within the actions´ settings is turned off.

    action settings screenshot

     

    In my case, both approaches simply created a new file version and have had no impact on the sharing link created beforehand.

  • Marius_Mockert's avatar
    Marius_Mockert
    Copper Contributor
    Hello all,

    no one has an idea how to solve this problem? Or should I share some additional information on the subject? Come on, I thought this place was crawling with professionals. 🙂

    Best regards
    Marius
    • Micca0815's avatar
      Micca0815
      Iron Contributor

      Marius_Mockert 

      Professionals might have to duty their profession 😉

      You could simply use 'get content using path' if your locations are this static and then perform an 'update file' action providing the content of it on your target file.
      This way a new version is created and any sharing link remains functional.

      Given that you might need to stick on the 'create file' action instead ensure the option 'Allow chunking'  below 'Content Transfer' within the actions´ settings is turned off.

      action settings screenshot

       

      In my case, both approaches simply created a new file version and have had no impact on the sharing link created beforehand.

      • Marius_Mockert's avatar
        Marius_Mockert
        Copper Contributor
        Hello Micca0815,

        Perfect, thank you very much. That does the trick. And you are right, both approaches work as you mentioned.

        Best Regards
        Marius

Resources