Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Delete the libraries which are modified more than 42 days

(0) ShareShare
ReportReport
Posted on by 16

I want to perform this below task where how come we filter the output to get only libraries

  • Get all Lists/Libraries from the site (There is an action to get all lists/libraries)
  • Filter the out put to get only Libraries
  • Loop through each library and get the expired documents
  • delete these documents.

Kindly advise me.

 

@eric-cheng

 

Yelams_0-1633699100205.png

 

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Delete the libraries which are expired more than 42 days

    @Yelams  Please run your flow and share your dates format. Please make sure that date formates match.

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

    @Hardesh /Gopenly.in

  • Yelams Profile Picture
    16 on at
    Re: Delete the libraries which are expired more than 42 days

     

    Please find the libraries of 

    Yelams_0-1634045611023.png

     

    Yelams_1-1634045712466.png

     

    Expired date is not showing in filter query how to get from all document libraries

     

     

  • Yelams Profile Picture
    16 on at
    Re: Delete the libraries which are expired more than 42 days

    @Hardesh15 

  • Yelams Profile Picture
    16 on at
    Re: Delete the libraries which are expired more than 42 days
    • Get all Lists/Libraries from the site (There is an action to get all lists/libraries)
    • Filter the out put to get only Libraries
    • Loop through each library and get the expired documents
    • delete these documents.

    Yelams_0-1634045352777.png

     

    I want to use filter query  i need to get the documents  from all libraries which are expired.

     

    Kindly advise me

     

    @eric-cheng

     

     

  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Delete the libraries which are modified more than 42 days

    @Yelams  i think this is wrong- expression 'item()['body.(created)']'

    Do one thing add one compose just above condition 2 and pass created from dynamic content and then copy whole input in a notepad then remove these-{,@,} once you do that then use item(.....).

     

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

    @Hardesh /Gopenly.in

  • Yelams Profile Picture
    16 on at
    Re: Delete the libraries which are modified more than 42 days

    Unable to process template language expressions for action 'Condition_2' at line '1' and column '15206': 'The template language expression 'item()['body.(created)']' cannot be evaluated because property 'body.(created)' doesn't exist, available properties are '@odata.etag, ItemInternalId, ID, Modified, Editor, Editor#Claims, Created, Author, Author#Claims, OData__DisplayName, {Identifier}, {IsFolder}, {Thumbnail}, {Link}, {Name}, {FilenameWithExtension}, {Path}, {FullPath}, {IsCheckedOut}, {VersionNumber}'. Please see https://aka.ms/logicexpressions for usage details.'.

     

     

    Yelams_0-1633922557140.png

     

    Please find the screenshot and help me

    @Hardesh15 

     

  • Yelams Profile Picture
    16 on at
    Re: Delete the libraries which are modified more than 42 days

    I created filter array and fetching the document libraries.

     

    Yelams_0-1633711051960.png

    found the below raw output.

     

    {
    "body": [
    {
    "Name": "0cce2ca3-baad-43ca-86c7-c119e8a6728a",
    "DisplayName": "Document Library 1",
    "Type": "101"
    },
    {
    "Name": "8c1bd727-a9ce-4186-8e04-71eee65e4acf",
    "DisplayName": "Document Library 2",
    "Type": "101"
    },
    {
    "Name": "997623e6-1a0e-4eb6-bbc9-a582e772eaa1",
    "DisplayName": "Documents",
    "Type": "101"
    },
    {
    "Name": "4887f97f-b673-4b63-880f-0cb66c7a6322",
    "DisplayName": "ExpireDocumentLibrary",
    "Type": "101"
    }
    ]
    }

     

    now i need to fetch all the files inside all document library.
    Kindly advise me

     

  • Yelams Profile Picture
    16 on at
    Re: Delete the libraries which are modified more than 42 days

    i have removed it.

    Still i am facing issue.

    Yelams_0-1633710626512.png

     

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Delete the libraries which are modified more than 42 days

    @Yelams  Please remove first value text from filter. 

    Hardesh15_0-1633708662772.png

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

    @Hardesh /Gopenly.in

  • Yelams Profile Picture
    16 on at
    Re: Delete the libraries which are modified more than 42 days

    @eric-cheng
    @ScottShearer

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow