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

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
Community Support Team
Community Support Team

Re: Filter Flow for only dates after max date

 

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
Community Support Team
Community Support Team

Re: Filter Flow for only dates after max date

 

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

Re: Filter Flow for only dates after max date

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

Community Support Team
Community Support Team

Re: Filter Flow for only dates after max date

 

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

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (5,133)