cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jjMedrano
Regular Visitor

Getting Items past 4 years Old

Hi guys, new to this here.

 

Trying to Get Items from our list of students where 'Enrollment Date' more than 4 years old in order to archive them (move them to another list)

 

I've tried a few methods but with no success. Any recomdations would help. Thank you.

Annotation 2019-04-10 165737.jpg

2 ACCEPTED SOLUTIONS

Accepted Solutions
ScottShearer
Super User
Super User

@jjMedrano 

 

The filter query probably needs to look like the screen shot below.  Please note the single quotes around the expression.  Also, the expression must be entered in the expression windows and not as plain text.

Expression.jpg

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

@jjMedrano 

What you'll need to do is to retrieve each related payment for each student before archiving the student record.  My screen shots below assume that the is a lookup column in the student payments list that points to the student list.  In my example the lookup column is called Student.  The ID of the student is actually stored in the lookup column.  So, it makes it easy to find any student payment associated with a student.

Once you retrieve the payments, you need to loop through each and archive (create a new item in another list and delete the original).

 

Please note that the ID column is only exposed in Dynamic properties when you click on "See more".

 

Student1.jpgStudent2.jpg

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

5 REPLIES 5
RookieI
Resolver I
Resolver I

It seems that the expression used in Filter Query is incorrect.

 

Missing operator, this should be le.

 

In addition, there are errors in the usage of Expression.

ScottShearer
Super User
Super User

@jjMedrano 

 

The filter query probably needs to look like the screen shot below.  Please note the single quotes around the expression.  Also, the expression must be entered in the expression windows and not as plain text.

Expression.jpg

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Perfect! Thank you so much. It works!

 

I have another issue that ties to the one before.

There is a 'Students Payments' list associated with the 'Students' list

 

Where.

Annotation 2019-04-11 115922.jpg

 

 


I would like to move payments associated with the students that got moved to archive to an archive list.

In other words, only move the payments of the students that got archived.

 

Is there a way to move only payments of Students "Enrollment Date" Past 4 years

Annotation 2019-04-11 120457.jpg

 

Where

Annotation 2019-04-11 115922.jpg

 

 

'Students' "ID" match 'Student Payment' "Student"

@jjMedrano 

What you'll need to do is to retrieve each related payment for each student before archiving the student record.  My screen shots below assume that the is a lookup column in the student payments list that points to the student list.  In my example the lookup column is called Student.  The ID of the student is actually stored in the lookup column.  So, it makes it easy to find any student payment associated with a student.

Once you retrieve the payments, you need to loop through each and archive (create a new item in another list and delete the original).

 

Please note that the ID column is only exposed in Dynamic properties when you click on "See more".

 

Student1.jpgStudent2.jpg

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Perfect. You're a life savior. Thank you so much. It works like a charm.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,383)