web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Archive files with Pow...
Power Automate
Unanswered

Archive files with Power Automate keeping the full file path

(0) ShareShare
ReportReport
Posted on by 2

Hello

Can anyone suggest how to archive files with Power Automate keeping the full file path?

As far as I understand, first we need to make the path to the folders in the Archive document library similar to the path to the main document library, and then move the files older than two years into the document library.

I am having problems creating a new folder path to the Archive document libraries.

 

Categories:
I have the same question (0)
  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @valeriya Pls share you flow screens & error message while creating folder path.

     

    Please 'Thumbs Up' the posts that helped you and 'Mark as Solution' if my post answered your question.

    @Hardesh

  • valeriya Profile Picture
    2 on at

    Sorry for such a late reply😬

    Here is the flow.

    Flow.png

    When the folder path is created, the library name is added to it. As a result, the file is not moved to the archive.

    Is it even the correct way to do this, if the goal is to move the files older than 2 years to archive?

  • PT-10121033-0 Profile Picture
    on at

    This is how I did it. I used a variable to set a "Root Folder" that needed to be removed from the path.

    ArchiveWithSP_1.png

    Then remove from the path:

    ArchiveWithSP_2.png

     

    A is:

    replace(outputs('Get_item')?['body/{Path}'],variables('RootFolderName'),'')

    B is simply:

    substring(variables('DestinationFolderName'), 0, sub(length(variables('DestinationFolderName')),1))

    Then use the Output:

    ArchiveWithSP_3.png

    You need to persist with the highlighted parts in this step - it might complain about syntax but just keep trying! e.g. you will need to type in the "Destination Folder" then add the "Dynamic Content" - it is not an "Expression"!

     

    C is the Identifier from the "Get item" step

    D is the ID from the "For a selected file" step

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard