cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter OData in SharePoint Get Files action by date

hi guys,

 

so I have a document library that is chokka blok full of documents(132k). I'm trying to get a way to move small ish blocks of documents into specific files. Im currently using the method below. My problem is that I know can only run a maximum of 5000 iterations of Apply to each, so to reduce the number of iterations I want to filter get files with an odata filter to pull out chunks of documents by the modified by or modified column. i just dont know how.

 

can anyone help - i've tried the documentation , by im obviously not tech enough to understand it

 

Currently the flow below works but never completes , it just runs and runs and runs

 

Recurrance

 

get files(Properties Only)

 

Apply to each

 

condition ( is eq to " text" )

 

get content

 

move file

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi @Anonymous,


Do you want to use filter query to return files based on the Modified date?
Let’s say you want files that modified date greater or equals 7 days ago from Today.
Then you could try the following code:

Modified ge 'formatDateTime(addDays(utcNow(),-7),'yyyy-MM-ddThh:mm:ssZ')'

Note: Please make sure the formatDateTime is surrounded by a single quote.

1.PNG
More details about Odata filter query, please check the following doc for more details:
https://docs.microsoft.com/en-us/previous-versions/dynamicsnav-2016/hh169248(v=nav.90)
If you need more help, please feel free post back.

 

Best regards,
Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jake_harvey
Frequent Visitor

Just a quick followup to this old post in case someone stumbles onto it and gets thrown off like I did. If you're trying to compare a date and need more granularity than days (in my case it's supposed to run every few hours) you'll need `HH` in the format. I was confused for a bit why the timestamps were so far off, and it's because lowercase `hh` is 12-hour. Uppercase `HH` is 24 hour. So my comparison thought things like 10 pm was 10 am.

Something like...

 

Modified ge 'formatDateTime(addHours(utcNow(),-3),'yyyy-MM-ddTHH:mm:ssZ')'

 

 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (67,669)