Hello Everyone,
I have a Gallery, I want to show all the data, when the user comes on this screen, and then when user selects date Range from top, the data should be displayed accordingly, somehow it's not working for me, the data does not show in the gallery when the user comes on the screen, however when the user selects the date range the data shows up.
What I have done is this
Gallery Items:
Sort(Filter('[dbo].[TimeSheet]',UserId= MyUser ,(Date>=DatePicker1_1.SelectedDate)&&(Date<=DatePicker1.SelectedDate)),Date,Ascending)
is there a way to show all the Data by Default and then apply filter on that
Any Help
Solved! Go to Solution.
Hi @MH3 :
Do you want to implement the following functions:
Case1:The user did not select the date in the two datapicker controls.
The gallery is displayed according to the following rules:
Sort(Filter('[dbo].[TimeSheet]',UserId= MyUser),Date,Ascending)
Case2:The user has selected a date in both date picker controls.
Sort(Filter('[dbo].[TimeSheet]',UserId= MyUser ,(Date>=DatePicker1_1.SelectedDate)&&(Date<=DatePicker1.SelectedDate)),Date,Ascending)
If so,I suggest you try this solution:
1\OnStart:
Set(var1,true);Set(var2,true);/*var1 and var2 is my custom variable*/
2\set the DatePicker1_1's OnChange property to:
Set(var1,false)
3\set the DatePicker1's OnChange property to:
Set(var2,false)
4\set the gallery's items property to:
Sort(If(var1 && var2,Filter('[dbo].[TimeSheet]',UserId= MyUser),Filter('[dbo].[TimeSheet]',UserId= MyUser ,(Date>=DatePicker1_1.SelectedDate)&&(Date<=DatePicker1.SelectedDate))),Created,Ascending)
Only when the options in both date selectors change, the records in the gallery are filtered according to the date selected by the user.
Best Regards,
Bof
Hi @MH3 :
Do you want to implement the following functions:
Case1:The user did not select the date in the two datapicker controls.
The gallery is displayed according to the following rules:
Sort(Filter('[dbo].[TimeSheet]',UserId= MyUser),Date,Ascending)
Case2:The user has selected a date in both date picker controls.
Sort(Filter('[dbo].[TimeSheet]',UserId= MyUser ,(Date>=DatePicker1_1.SelectedDate)&&(Date<=DatePicker1.SelectedDate)),Date,Ascending)
If so,I suggest you try this solution:
1\OnStart:
Set(var1,true);Set(var2,true);/*var1 and var2 is my custom variable*/
2\set the DatePicker1_1's OnChange property to:
Set(var1,false)
3\set the DatePicker1's OnChange property to:
Set(var2,false)
4\set the gallery's items property to:
Sort(If(var1 && var2,Filter('[dbo].[TimeSheet]',UserId= MyUser),Filter('[dbo].[TimeSheet]',UserId= MyUser ,(Date>=DatePicker1_1.SelectedDate)&&(Date<=DatePicker1.SelectedDate))),Created,Ascending)
Only when the options in both date selectors change, the records in the gallery are filtered according to the date selected by the user.
Best Regards,
Bof
Hello, Sir @v-bofeng-msft
Your Approach is working on my gallery, but when I am removing both the selected dates filter from my gallery, it shows empty.
however it should show all the data of that user when the filter is removed,
I was using the onChange Property on my Date Pickers
Before DatePicker1_1: OnChange Code:
ClearCollect(Records,Filter('[dbo].[TimeSheet]',Text(Date,"[$-en-US]dd/mm/yyy")=Text(DatePicker1_1.SelectedDate,"[$-en-US]dd/mm/yyy")))
Before DatePicker1: OnChange Code:
ClearCollect(Records,Filter('[dbo].[TimeSheet]',Text(Date,"[$-en-US]dd/mm/yyy")=Text(DatePicker1.SelectedDate,"[$-en-US]dd/mm/yyy")))
The Filter remove button code:
ClearCollect(Records,'[dbo].[TimeSheet]');
Reset(DatePicker1);Reset(DatePicker1_1)
@v-siky-msft
When User clicks on this filter icon, the date filter should reset and all the data should show up, but it's not working in this
Kindly Help!!!
will it work for share point too?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
187 | |
52 | |
51 | |
34 | |
33 |
User | Count |
---|---|
266 | |
97 | |
84 | |
76 | |
73 |