Greetz,
Just a noob question, i'm using a datepicker and i want it to remember the selected date on it. I mean not Defaultdate = Now() but the date you selected in an earlier session.
Thx in advance..
Maik
Solved! Go to Solution.
I suggest you rather inset a Datepicker into the Gallery and Change the date from inside the Gallery instead of outside the Gallery. Unless you want same dates for all.
Also what code is on the Datepicker inside the Gallery?
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Pfff can't find it 🤣
Now() is a function that always loads todays date. So it doesn't remember what the date was it just loads todays date. The date picker doesn't maintain any storage after the app closes. So to get it to use the last date selected you need to save that date somewhere and then use it to set the default in an If() that checks whether a date was saved or not. If not it uses today, if there was a saved date it uses that one.
Set a Variable on the OnSelect of the DatePicker:
Set(varLastDate,DatePicker1.SelectedDate)
Then you can use varLastDate which would contain the earlier date selected
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Oke i understand the idea 🙂 do you have an example? Do i save it in a textinput and the set the defaultdate to that textinput or do i think to easy now 🙂
Thx in advance..
As @eka24 said you can save it in a local variable. That will work until you close the app. But if you want it to reset after closing and opening the app you need to save it to a data source of some kind. Then when you start the app load the value from the data source to a local variable. Set the defaultDate of the datepicker as follows.
if(isBlank(variableName),Now(),variableName)
I need the datepicker to be the date i selected because i fill a column in a list with that date and after closing it has to be that date 🙂
Can you give a screen shot to explain further your points. How many datepickers are you using?
Also are you using a form?
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
I'm using a list for the students and i redirect Datum to DatePicker, with the button i patch the Datum column with the date and that works fine but the date keeps changing on opening the app in a new session 😞 The date in the datepicker has to be the date set. I don't use a form, it's just an app for checking if there is a spot on that date (max 8 per moment, that is a list).
Mny Thx allready..
(just a noob here)
I suggest you rather inset a Datepicker into the Gallery and Change the date from inside the Gallery instead of outside the Gallery. Unless you want same dates for all.
Also what code is on the Datepicker inside the Gallery?
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
253 | |
122 | |
84 | |
84 | |
67 |