cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pchristou
Regular Visitor

Date Picker

Good afternoon,

I created an app using my list and it came with a date picker from which you can choose the date. However it won't update the record and I also can't seem to be able to reference it in a label for 2 reasons:

1) It uses scope

2) It produces a circular error

I just need to fix the date picker for the app to work and the only option I find online is to switch it to text.

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @pchristou,

Could you please share more details about your scenario, post a picture to show me how you configure your app?

Do you want to display the date in a Label and save it to your list?

1). If you want to display the date picker selected date within a Label, set the Text property of the Label as below:

Text(DatePicker2.SelectedDate,"yyyy-mm-dd")

vqiaqimsft_0-1628662647668.png

2). To update the date, as @StalinPonnusamy said, if you have an edit form, you should attention how you set the data card Update property.

if you have a single date picker and a save button, you should write the Patch() as below.

Whether to switch it to text depends on the column type of your date column:

a). if it is a Date and time type, you could save it using DatePicker2.SelectedDate

Patch(
        YourList,
        Defaults(YourList),
        {
            DateColumn: DatePicker2.SelectedDate 
        }
    )​

b). if it is a Single-line-of-text type, you could save it using Text(DatePicker2.SelectedDate,"yyyy-mm-dd") 

Patch(
        YourList,
        Defaults(YourList),
        {
            DateColumn: Text(DatePicker2.SelectedDate,"yyyy-mm-dd")
        }
    )​​

Hope it could help you at some degree

Best Regards,
Qi

View solution in original post

3 REPLIES 3
StalinPonnusamy
Community Champion
Community Champion

Hi @pchristou 

 

Please verify the update property of the Data Card which is tied to Date. It should be Datepicker.SelectedDate

StalinPonnusamy_0-1628624409990.png

 

v-qiaqi-msft
Community Support
Community Support

Hi @pchristou,

Could you please share more details about your scenario, post a picture to show me how you configure your app?

Do you want to display the date in a Label and save it to your list?

1). If you want to display the date picker selected date within a Label, set the Text property of the Label as below:

Text(DatePicker2.SelectedDate,"yyyy-mm-dd")

vqiaqimsft_0-1628662647668.png

2). To update the date, as @StalinPonnusamy said, if you have an edit form, you should attention how you set the data card Update property.

if you have a single date picker and a save button, you should write the Patch() as below.

Whether to switch it to text depends on the column type of your date column:

a). if it is a Date and time type, you could save it using DatePicker2.SelectedDate

Patch(
        YourList,
        Defaults(YourList),
        {
            DateColumn: DatePicker2.SelectedDate 
        }
    )​

b). if it is a Single-line-of-text type, you could save it using Text(DatePicker2.SelectedDate,"yyyy-mm-dd") 

Patch(
        YourList,
        Defaults(YourList),
        {
            DateColumn: Text(DatePicker2.SelectedDate,"yyyy-mm-dd")
        }
    )​​

Hope it could help you at some degree

Best Regards,
Qi

View solution in original post

microconsulting
Frequent Visitor

@pchristou , @v-qiaqi-msft , @StalinPonnusamy ,

ezgif.com-gif-maker (1).gif

 

Check out custom date picker control for Power Apps.

Please check this link for installation instructions.

http://themicroconsulting.com/powerapps-custom-calendar-component-with-time-picker/

 

Your feedback will be more than appreciated.

 

Thanks 🙂

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,381)