cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dyna009
Helper I
Helper I

Filter current Date Record between start date and end Date

I am trying to filter record in canvas app from data verse and i want that record only which is contains today's date.

I have high priority task, please any one can help me in this.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ismael_Novo
Resolver III
Resolver III

Dear Dyna009.

 

I provide you with an example where I use the "With" function to make it easier to read. The key to get records for today only is, first get two dates with the times 00:00 and 23:59 to then make a filter that checks if the record is in that time slot. I think it's easy to understand just by looking at the code.

 

For the test I used a Sharepoint list with a date column, and to avoid delegation warnings one of the parameters is to load the list items:

 

With( {
    Rows : Test ; 
    TodayIni: Date(Year(Now());Month(Now());Day(Now())) ;
    TodayEnd: Date(Year(Now());Month(Now());Day(Now())) + Time(23;59;59)
} ;
    Filter(Rows;
        MyDate < TodayEnd ;
        MyDate > TodayIni
    )
)

 Greetings

View solution in original post

4 REPLIES 4
Ismael_Novo
Resolver III
Resolver III

Dear Dyna009.

 

I provide you with an example where I use the "With" function to make it easier to read. The key to get records for today only is, first get two dates with the times 00:00 and 23:59 to then make a filter that checks if the record is in that time slot. I think it's easy to understand just by looking at the code.

 

For the test I used a Sharepoint list with a date column, and to avoid delegation warnings one of the parameters is to load the list items:

 

With( {
    Rows : Test ; 
    TodayIni: Date(Year(Now());Month(Now());Day(Now())) ;
    TodayEnd: Date(Year(Now());Month(Now());Day(Now())) + Time(23;59;59)
} ;
    Filter(Rows;
        MyDate < TodayEnd ;
        MyDate > TodayIni
    )
)

 Greetings

bapala
Resolver IV
Resolver IV

Dear @dyna009 ,

 

Thank you @Ismael_Novo. Sorry, I have copied your answer and just modified SDate and EData formulas.
Today records.jpg

Ismael_Novo
Resolver III
Resolver III

Nice! Much more clean!

dyna009
Helper I
Helper I

@bapala and @Ismael_Novo 

Thank you so much for giving me solution. and its work perfectly.

and i have another task related to date in canvas app.

 

 

i am trying to filter record from date base,

i choose start date and end date, now i just want to know that any of record in same date is available . 

 

And i just do this code for same.

 

ClearCollect(
MatchUserDataPending1,
Filter(
Requests,
Requester.'Primary Email' = _myProfile.UserPrincipalName && 'Request Status' = [@'Request Status'].Pending && 'Start Date' <= DateValue(StartDateConvert) && 'End Date' >= DateValue(EndDateConvert)
)
);

 this task is also in high priority, please help me.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,825)