Notifications
Announcements
On my screen, I created a pop-up like function that will allow the user to edit a few fields from the selected gallery record, then click a button that will perform a Patch and update just those few fields. One of the fields is a date picker field. I would like the data populated in the date picker field to be that of the gallery's selected record, but using the Default Date field defaults it for ALL records. Any ideas?
To get data from your gallery you can simply use the "selected" property.This gives access to both the gallery's data and the actual controls themselvesSee below examples
Gallery1.Selected.DatePicker1.SelectedDate //select through the control Gallery1.Selected.mydateColumn //selects through the data source itself
Hi Annette,Do I understand it correctly that the Date Picker value within the pop-up needs to be the date of that specific selected record? In this case, adding the following code to the Default Date field should work:
Gallery.Selected.DateField
Would it be possible to show what is meant with 'defaults for all records'?
In your gallery, in the datepicker, set your DefaultDate:
ThisItem.NameOfYourDateColumn
Replace NameOfYourDateColumn with the actual column name 🙂
I found out my issue! I was using the code you all suggested (Gallery.Selected.DateField), however it was not working. The reason was that the date picker on my pop-up screen had a start year of 1970 and the dates from the records selected from the gallery were before 1970. So, if I attempted to change a date from 5/10/1943 to 5/10/1950, it would not let me and it would default to 1/1/1970. Once I changed the start year on my pop-up's date picker, the code you all noted (and I was using), worked!
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 717 Most Valuable Professional
Michael E. Gernaey 329 Super User 2025 Season 2
Power Platform 1919 268