cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TesDA
Continued Contributor
Continued Contributor

Filter Flow for only dates after max date

I have two tables, where I would like to append data to the second table. My trouble is with "Filter Array"

Table 1

housed in Common Data Service

Important column: Created Date

 

Table 2

housed in SQL Server

Important column: Created Date

 

Im trying to create a flow that:

Sends data from Table 1 to Table 2

The data it sends should be greater then the maximum created date in table 2 for the column

So basically Id like to create a filter that does the following:

Table1.CreatedDate> max(Table2.CreatedDate)

 

Everything else is working, Im just having trouble creating this filter

 

Here is what I have tried that isn't working:

 

Image 7.png

1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @TesDA ,

 

You could try this configuration:

38.PNG39.PNG40.PNG

 

Best Regards,

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

View solution in original post

3 REPLIES 3
v-bacao-msft
Community Support
Community Support

 

Hi @TesDA ,

 

You could use Get rows to get the row with the largest Date.

 

Set Order by to sort in descending order according to the date field, and then set the Top count to 1, so that you can get the largest date.

 

Then store the date in a variable.

 

Then get the data in the CDS, traverse table1, and see if Table1.CreatedDate is larger than the largest Date obtained before.

 

If so, store this record in the Sql table.

 

Hope it makes sense.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TesDA
Continued Contributor
Continued Contributor

What Ive done is similar. I just did the max(Created Date) in sql server. I then initialized a variable in flow for this table but it didn't work. Is it possible you could show me what you do when you initialize the variable in flow? I must be doing this wrong.

 

I added a visual to the original post to show what Ive done that isn't working

 

Hi @TesDA ,

 

You could try this configuration:

38.PNG39.PNG40.PNG

 

Best Regards,

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,782)