cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Resolver III
Resolver III

create collection filtered on created date -31 days

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
C-Papa
Super User
Super User

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

View solution in original post

dennisb88
Resolver III
Resolver III

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

 

View solution in original post

3 REPLIES 3
C-Papa
Super User
Super User

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

View solution in original post

dennisb88
Resolver III
Resolver III

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

 

View solution in original post

pbaxter
Regular Visitor

@dennisb88 super helpful thanks for the solution!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,456)