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.
Solved! Go to Solution.
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
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
Dear @dyna009 ,
Thank you @Ismael_Novo. Sorry, I have copied your answer and just modified SDate and EData formulas.
Nice! Much more clean!
@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.
User | Count |
---|---|
253 | |
106 | |
92 | |
47 | |
37 |