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
These queries are great.
Is there any way to return only the ones with NULL?
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:
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:
Regards,
Michael
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional