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

Filter by DatePicker

Hello all, I am wondering if anyone could help me out here. I would like to have the ability to filter my gallery using a DatePicker, but also retain the ability to show all dates in the gallery as well? Is this even possible?

 

Any help at all would be appreciated.

Thanks

15 REPLIES 15

To Add on, the "Start Date" is not placing the Default Date to the Datepicker. When i start the app with new version the "Start Date" clear the submitted date. For example: Let's assume there is a claim which was submitted on 05/08/2018, further when i open an app today i can see that the "Start Date" does not contain the date anymore, what i need is i need set the default date as the First Submitted Date to the "Start Date" datepicker.

mr-dang
Community Champion
Community Champion

Hi,@Nikhil2,

If I understand correctly, the start date is not showing its default date, and as a result, the end date is not either because it needs to add 1 to the startdate.

 

In your app sequence, when/where is the first time you define the variable ExpenseStartDate?

 

If you can make sure that variable is not null--define it OnStart or OnVisible somewhere, it may resolve your issue.

 

Let me know if that works.

 

 

__________________

Microsoft Employee
@8bitclassroom

Hello Mr.Dang,

 

Hope you are doing well !

 

Well on to the below note, "Start Date" Depending upon user input. Let's assume: I may submit today as my first expense or another user may submit tommorrow as his/her first expense. 

 

Here i need to set the default date as when the first expense hits the "Browsegallery1". And yes for "End Date" i can make the default date as "today()" as currently i have no issue on End Date. 

 

ExpenseStartDate i have defined the variable to the button "Apply" and to "Start Date", and the datePicketStart is fetching the values from Editform1. Where i have added the one more datepicker as defaultdate "today()".

 

That is where actually it is storing the value to "Browsegallery1" and i need to push the date value to "Start Date" as when the very First Claim was Submitted.

 

Meanwhile i will try to implement on the OnStart and OnVisible Property. At the same time if possible for the workaround suggestion would be appreciated.

 

Thanks and Regards,

Nikhil

Hello Mr.Dang,

 

Hope you are doing well !

 

Looks like below properties doesn't seem to work, because for the datepicker control do not have option "OnSelect" and for "OnVisible" doesn't seem to be working. If find alternative option would be great to implement.

 

1. The initial date actually fetching from edit form where i have setted the defaultdate as "today()".

2. Later i am calling the date in the gallery using the code to Text property Thisitem.created.

3. Now the datepicker play its role, Startdate sets it DefaultDate property to "ExpensestartDate" and for End Date"Today()"

4. For the button "Apply" i have defined the value to "OnSelect" property Set(ExpenseStartDate, datePickerStart.SelectedDate); Set(ExpenseEndDate, datePickerEnd.SelectedDate); Back()

 

Perhaps i could not notice where i am actually stumbling to set up the defaultdate to startdate. Please consider the above example for the startdate.

 

Thanks and Regards,

Nikhil.

mr-dang
Community Champion
Community Champion


@Nikhil2 wrote:

 

Looks like below properties doesn't seem to work, because for the datepicker control do not have option "OnSelect" and for "OnVisible" doesn't seem to be working. If find alternative option would be great to implement.

 

1. The initial date actually fetching from edit form where i have setted the defaultdate as "today()".

2. Later i am calling the date in the gallery using the code to Text property Thisitem.created.

3. Now the datepicker play its role, Startdate sets it DefaultDate property to "ExpensestartDate" and for End Date"Today()"

4. For the button "Apply" i have defined the value to "OnSelect" property Set(ExpenseStartDate, datePickerStart.SelectedDate); Set(ExpenseEndDate, datePickerEnd.SelectedDate); Back()


 

If you de-select all the items on the screen, you will be able to access the OnVisible property of the screen. The OnVisible property will perform the actions when the user navigates to that screen. So you can use the OnVisible property to declare your ExpenseStartDate to the date of your choice:

 

Screen.OnVisible:

Set(ExpenseStartDate,date_that_you_want)

Let me know if this helps.

 

Mr. Dang

_____________

Microsoft Employee
@8bitclassroom

Hello Mr.Dang,

 

Looked like the solution worked out for the issue. Thank you for setting up the code in the quick time, Perhaps there is a small lag again. if you see the date which was submitted on 5/9/2018. Which suppose to be on the top the table like in the first place, but somehow the filter for the gallery seems to be not working.

 

The dates needs to be assemble accordingly with Descending to Ascending for Ex: it should start from 5/9/2018 to till date. Unfortunate it jumbles the dates and the code for the gallery is: 

 

SortByColumns(Filter('TEST APP',(Author.DisplayName=User().FullName),And(Created>=datePickerStart.SelectedDate, Created<=datePickerEnd.SelectedDate), Or(Created="All", Status.Value="Open", Status.Value="Approved", Status.Value="Pending"), StartsWith(Claim_x0020_Title, TextSearchBox1.Text)), "Cost",If(SortDescending1, Descending, Ascending))

 

Cap3.PNG

 

Thanks and Regards,

Nikhil.

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 (3,312)