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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / create collection filt...
Power Apps
Answered

create collection filtered on created date -31 days

(0) ShareShare
ReportReport
Posted on by 603

Hi all,

 

A short question, I've in my onvisible settings a clear collect where I'm collection all the records that are not older then 31 days.

To achieve that I've build the follow code:

 

ClearCollect(
 Col_Myhours,
 Filter(
 registration,
 User = Var_User, Created >= DateAdd(
 Today(),
 -31,
 Days
 )
 )
)

It works fine, my collection is filled. But it's give me the error: "Date add function cannot be blank".

 

I didn't know what/ where the issue is.. Does anyone know what's wrong?

 

Regards,

Dennis

Categories:
I have the same question (0)
  • Verified answer
    C-Papa Profile Picture
    1,836 on at

    Try setting the date add value in a variable and using the variable in the formula

  • Verified answer
    dennisb88 Profile Picture
    603 on at

    Hi @C-Papa , thank you for your reply.

     

    You're suggestion was the right one! Thanks!

     

    The correct formula:

    Set(
     var_date,
     DateAdd(
     Today(),
     -31,
     Days
     )
    );
    ClearCollect(
     Col_Myhours,
     Filter(
     registration,
     User = Var_User,
     Gemaakt >= var_date
     )
    )

     

  • pbaxter Profile Picture
    8 on at

    @dennisb88 super helpful thanks for the solution!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard