web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter by date being s...
Power Apps
Unanswered

Filter by date being sent in quotes

(0) ShareShare
ReportReport
Posted on by 66

Hi all

I'm using the Salesforce connector to display data in a Canvas App. We have thousands of records, but I only need to work with any modified in the last seven days. To avoid delegation, I've got this function, which filters from the Grants Salesforce Table:

UpdateContext(
    {
        newGrants: Filter(
            Grants,
            'Last Modified Date' >= DateAdd(
                Today(),
                -7,
                TimeUnit.Days
            )
        )
    }
);

 

But it is getting this error: 

Salesforce failed to complete task: Message: wrdd_Dt__c FROM Grant__c WHERE (LastModifiedDate >= '2024-03-18T00:00:00.000Z') ^ ERROR at Row:1:Column:2032 value of filter criterion for field 'LastModifiedDate' must be of type dateTime and should not be enclosed in quotes

 

nksse_0-1711376438777.png

 

I've also tried enclosing the DateAdd in DateValue and DateTimeValue functions with no avail...

 

Can anyone shed some light on how I can filter by date?

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @nksse -

     

    Have you considered removing the single quotes with Substitute prior to running the DateValue function? E.g.

     

    UpdateContext(
     {
     newGrants: Filter(
     Grants,
     DateValue(
     Substitute(
     'Last Modified Date',
     "'",
     ""
     )
     ) >= DateAdd(
     Today(),
     -7,
     TimeUnit.Days
     )
     )
     }
    )

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard