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

Community site session details

Session Id : iSnGJOKvksh1RhG9Z8azKy
Power Apps - Building Power Apps
Answered

create collection filtered on created date -31 days

Like (0) ShareShare
ReportReport
Posted on 7 Apr 2021 10:18:19 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

  • pbaxter Profile Picture
    8 on 21 Jul 2021 at 19:28:35
    Re: create collection filtered on created date -31 days

    @dennisb88 super helpful thanks for the solution!

  • Verified answer
    dennisb88 Profile Picture
    603 on 07 Apr 2021 at 11:37:10
    Re: create collection filtered on created date -31 days

    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
     )
    )

     

  • Verified answer
    C-Papa Profile Picture
    1,836 on 07 Apr 2021 at 11:22:16
    Re: create collection filtered on created date -31 days

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

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473