Skip to main content

Notifications

Community site session details

Community site session details

Session Id : HXUGf3VKWoQK/jBgvNw/se
Power Automate - Building Flows
Unanswered

Get rows from a sql server table an need filter records with current date

Like (0) ShareShare
ReportReport
Posted on 20 Jun 2017 16:34:43 by

Hello

My flow get rows from a sql server table and i need to filter records of this step with a field greater or equal with current date

How can i do that ?

Thanks

  • kevinsray Profile Picture
    209 on 13 Aug 2018 at 23:15:09
    Re: Get rows from a sql server table an need filter records with current date

    These queries are great.

    Is there any way to return only the ones with NULL?

  • v-micsh-msft Profile Picture
    on 21 Jun 2017 at 07:10:36
    Re: Get rows from a sql server table an need filter records with current date

    Hi @Anonymous,

     

    Basically we could filter the results in two ways:

    1. Use the Filter Query (OData query) within the SQL Server ->Get Rows action, the formula used here would obey the OData query rules, and it only available for fixed value, which can't support dynamic content,

    2. Use the filter Array action, then take advantage of the Advanced edit mode to write the condition formula

     

    In your situation, as you would like to filter the rows based on the current date, then we should choose option 2 to filter the results.

    Screenshots:

    42.PNG

    Some additional inforamtion needed, if the fields which hold the checking date contain NULL value, and you would like this row to be removed, then the formula should be:

    @greaterorequals(
    formatdatetime(coalesce(item()?['datefield'],
    '2017/6/1'),
    'yyyy/MM/dd'),
    utcnow('yyyy/MM/dd')
    )

    If the row which has the Datefield with null value is required, then use the formula below:

    @greaterorequals(
     formatdatetime(coalesce(item()?['date2Datetime'],
    utcnow()),
    'yyyy/MM/dd'),
    utcnow('yyyy/MM/dd'))

    Filter Array output should be the rows you wanted.

    Function reference:

    Workflow definition language

     

    Regards,

    Michael

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started
Loading complete