cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jjMedrano
Level: Powered On

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
Super User
Super User

Re: Getting Items past 4 years Old

@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

Super User
Super User

Re: Getting Items past 4 years Old

@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
Level: Powered On

Re: Getting Items past 4 years Old

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.

Super User
Super User

Re: Getting Items past 4 years Old

@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
Level: Powered On

Re: Getting Items past 4 years Old

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"

Super User
Super User

Re: Getting Items past 4 years Old

@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

jjMedrano
Level: Powered On

Re: Getting Items past 4 years Old

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 341 members 5,932 guests
Please welcome our newest community members: