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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Retrieve a date

(0) ShareShare
ReportReport
Posted on by 277

Hi guys,


I have a list in sharepoint that has three text type fields one is for the month, another for the day and another for the month and the last one for the year.


This list I have it in a collection where I show the records, but I need to create a display to be able to edit the records, so my question is: Is it possible to put these three fields together, convert them in date format and show it in a date picker? I mean, if I selected a record that has 03, 06, 1998, the control will show 03/06/1998.

 

Thank you in advance guys,

 

 

Categories:
  • Sunil-Narnaware Profile Picture
    681 on at

    @ADumith How are you selecting the record (SharePoint List Record)? I mean how it is tied up to your control? is it form or gallery?

  • Sunil-Narnaware Profile Picture
    681 on at

    @ADumith Based on how you get your SharePoint record.. this is how you should be able to construct your date in DatePicker' DefaultDate property 

    Date(varDayMonthYear.Year, varDayMonthYear.Month, varDayMonthYear.Day)

     
    In my case, I have stored the SharePoint list record in variable varDayMonthYear

  • ADumith Profile Picture
    277 on at

    Hello Sunil, 

     

    I just populate my collection with the whole list, so when the user move from one record to another I'm try to show the records details in a group of fields.

     

    Collection

    ADumith_0-1661804208820.png

    The Hired Day Column and Birthday Column are columns compounds by concatenating two or tree fields:

    ThisItem.'Hired-Month' & "/" & ThisItem.'Hired-Day' & "/" & ThisItem.'Hired-Year'

     

    Next to this one I have this box:

    ADumith_1-1661804444889.png

     

    So when the user select one record, in this box I want to show the record selected, only left the Hired day.

     

    Let me know if you need more explanation.

     

    Thank you in advance,

  • Sunil-Narnaware Profile Picture
    681 on at

    @ADumith 

    Can you set the DefaultDate property of Hired Day DatePicker Control to 

    Date(ThisItem.'Hired-Year', ThisItem.'Hired-Month', ThisItem.'Hired-Day')
    

      

  • ADumith Profile Picture
    277 on at

    Hello Sunil, 

     

    I did it this way:

     

    Date(Gallery3.Selected.'Hired-Month',Gallery3.Selected.'Hired-Day',Gallery3.Selected.'Hired-Year')

     

    But, when I jump from one record to another the date picker doesn't refresh, any idea?

     

    Thank you,

  • Sunil-Narnaware Profile Picture
    681 on at

    @ADumith Instead of using Gallery3.Selected save that information in Global Variable.. so OnSelect of Gallery Item.. Set(varSelectedRecord, Gallery3.Selected) and then use varSelectedRecord.'Hired-Month' and so forth..
    Let me know how it goes

  • ADumith Profile Picture
    277 on at

    Hello Sunil

     

    I'm new in Power Apps, so just touching bases:

    1.- Set a global variable in OnSelected (in the galerry). How would be?

    2.-Use the variable in DefaultDate property

     

    son at the end will be like this:

     

     

    Date(varSelectedRecord.'Hired-Month',varSelectedRecord.'Hired-Day',varSelectedRecord.'Hired-Year')

     

     

    Thank you,

  • Sunil-Narnaware Profile Picture
    681 on at

    Hi @ADumith ,

    Correct.. Set the Variable on OnSelect property of Gallery

    SunilNarnaware_0-1661895674920.png

    Make sure Select(Parent) is set to OnSelect of each labels..icons inside gallery.. say like in above example the  onselect property for '>' is set to Select(Parent) --> Which obviously you would find set 

    Then use the varSelectedRecord in DefaultDate property of Date Picker, like what you have mentioned above


  • ADumith Profile Picture
    277 on at

    As you suggested, I did this:

    ADumith_0-1662140568245.png

    Them on the Date Picker:

    ADumith_1-1662140986067.png

     

    Result:

    The date picker doesn't change when I move from one record to another one.

     

    Any other idea?

     

    By the way, I appreciate your support.

  • ADumith Profile Picture
    277 on at

    Hello @Sunil-Narnaware ,

     

    Did you get my last message?

     

    Thank you 😊

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard