web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Edit date picker field
Power Apps
Unanswered

Edit date picker field

(0) ShareShare
ReportReport
Posted on by

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?

Categories:
I have the same question (0)
  • Tolu_Victor Profile Picture
    197 Super User 2024 Season 1 on at

    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 themselves
    See below examples

    Gallery1.Selected.DatePicker1.SelectedDate
    //select through the control
    
    Gallery1.Selected.mydateColumn
    //selects through the data source itself

     

  • LaurensM Profile Picture
    12,516 Moderator on at

    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'?

  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    In your gallery, in the datepicker, set your DefaultDate:

    ThisItem.NameOfYourDateColumn

    Replace NameOfYourDateColumn with the actual column name 🙂

  • Verified answer
    AnnetteM Profile Picture
    on at

    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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard