Skip to main content

Notifications

Power Platform Community / Forums / Design & Build / How to use the Filter ...
Design & Build
Unanswered

How to use the Filter Array action on a field that is sometimes null

Posted on by
I'm using the HTTP action to pull records from a 3rd party provider.  I want to only bring in records where the 'OptionDate' field value is greater than '2024-01-01', however some of the records have a null value for 'OptionDate'.  As you can imagine, as soon as the GET encounters a record with a null value for 'OptionDate', the flow stops with a failure. 'The template language function 'greaterOrEquals' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.
 
Is there a way, using advanced mode in the Filter Array action, to say something like, 'if field not null, then check to see if greater than 2024-01-01'?
 
Thanks
Categories:
  • Suggested answer
    SaiRT14 Profile Picture
    SaiRT14 317 on at
    How to use the Filter Array action on a field that is sometimes null
    check if the OptionDate is not null, If it’s not null, then compare it to your date (2024-01-01).
    @and(
       not(equals(item()?['OptionDate'], null)),
       greaterOrEquals(item()?['OptionDate'], '2024-01-01')
    )

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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Tuesday Tip #2 Global Search…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,008

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,531

Leaderboard

Featured topics