cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ØsFënrîr
Helper I
Helper I

How to select data from 30 days?

Hello to you.
I am currently looking to create a Flow that removes an item from a list contained in a SharePoint when between that creation date and the date of the day is more than 30 Days.
Despite my perseverance and my many tries I can not get this ....  😶
Someone to give me a little boost?

1 ACCEPTED SOLUTION

Accepted Solutions
Mira_Ghaly
Dual Super User
Dual Super User

@ØsFënrîr 

If you used this action you will get a time in the past 30 days earlier

Mira_Ghaly_0-1615809147732.png

The you need to get items from your list where your filter be like

Mira_Ghaly_1-1615809230639.png

Expression should be:

formatDateTime(body('Get_past_time'),'yyyy-MM-dd')

 

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

View solution in original post

18 REPLIES 18
Mira_Ghaly
Dual Super User
Dual Super User

@ØsFënrîr 

If you used this action you will get a time in the past 30 days earlier

Mira_Ghaly_0-1615809147732.png

The you need to get items from your list where your filter be like

Mira_Ghaly_1-1615809230639.png

Expression should be:

formatDateTime(body('Get_past_time'),'yyyy-MM-dd')

 

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

I don't really understand what "Created h" means:/

Mira_Ghaly
Dual Super User
Dual Super User

@ØsFënrîr

Created lt '' 

Created:is your column name

lt: less than 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Hoping, you remember this subject and I do not disturb you ...
I understood what the method indicated was and that's exactly what I'm looking for.
that's why I checked the solution, however my flow does not run because of my function inscribed in the query filter which is :Capture d’écran 2021-03-16 110209.png
Where Fx -> formatDateTime (body (body( 'Get'), 'yyyyy-MM-dd') // Get = Name of my PastTimer of -15Day

The error display is as follows : The expression Created It "2021-03-01" is not valid. Creating query failed.
customerRequestId: 5398490d-4775-443a-a6e4-f5a6444d0c19

In my Sharepoint my list looks like this :Capture d’écran 2021-03-16 111927.pngWhere the type of Created is Date and in addition to the three outputs used in my example, there are also equal to today - 15 days

  

I hope to have once again your help to help me understand and solve my mistake 😕

Mira_Ghaly
Dual Super User
Dual Super User

@ØsFënrîr

Can u try to use single quotes around formatdatetime instead of double quotes, also are u passing the output from get past time to the formatdatetime? 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

no change with singles quotes and yep I passing the output from get past time to the formatdatetime

Mira_Ghaly
Dual Super User
Dual Super User

@ØsFënrîr

Can u share screens of your flow please?

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Sure ! 🙂
My Flow is in French I hope it's doesn't bother youCapture d’écran 2021-03-16 121055.pngCapture d’écran 2021-03-16 121207.png

Mira_Ghaly
Dual Super User
Dual Super User

@ØsFënrîr

So the column in sharepoint is named Created or it is in French? 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

 is named Created

Mira_Ghaly
Dual Super User
Dual Super User

@ØsFënrîr so after single quotes u still get the same error message?

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Yes exactly the same

Mira_Ghaly
Dual Super User
Dual Super User

@ØsFënrîr

Can u change the column format in sharepoint to Date Only

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

I would like do that but that Apparently impossible to change this column (i don't have the proposal to change the column)

Mira_Ghaly
Dual Super User
Dual Super User

@ØsFënrîr

Sorry but can u make sure no space before or after single quotes 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

And between It and the first ' ?

I have to go for 40-50m but thanks you for taking the time to help me, on my return I'm going to change the format of the date of Created

Mira_Ghaly
Dual Super User
Dual Super User

There should be one space between lt and the first '

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (3,304)