cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Get modified date of lists and libraries

I am trying to get the Modified date of a library, but failing miserably.. 

The issue is, we want to "archive" any library that has a modified date older the 1/1/2021..

 

Once I can figure out how to retrieve the Modified Date of the library, the the rest of the flow should go easy..
Setup a very basic flow to start, and this does get all the lists and Libraries:

shanemeisnerdhg_1-1651077591542.png

But no matter if I use Value, Body or Item to set the variable, it always returns the same data:

shanemeisnerdhg_2-1651077693947.png

any thoughts?

 

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @shanemeisnerdhg ,

I think you'll need an HTTP request to SharePoint to get more information about a list.

Method: GET

Uri: _api/web/lists/getByTitle('ListName')

you can then extract the information from the list by navigating the JSON output, e.g. the date of the last modified item:

body('Send_an_HTTP_request_to_SharePoint')?['d']?['LastItemModifiedDate']

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

2 REPLIES 2
tom_riha
Super User
Super User

Hello @shanemeisnerdhg ,

I think you'll need an HTTP request to SharePoint to get more information about a list.

Method: GET

Uri: _api/web/lists/getByTitle('ListName')

you can then extract the information from the list by navigating the JSON output, e.g. the date of the last modified item:

body('Send_an_HTTP_request_to_SharePoint')?['d']?['LastItemModifiedDate']

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

@tom_riha Thank you.. That worked!! 
Only thing I had to change was use "LastItemUserModifiedDate", as for whatever reason the LastItemModifiedDate had yesterday's date.. 

 

"LastItemModifiedDate": "2022-04-27T13:34:01Z",
"LastItemUserModifiedDate": "2022-02-21T15:40:57Z", 

As I just wanted to run this against the libraries, I added a Filter Array:

shanemeisnerdhg_0-1651172425033.png

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,660)