cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StevenTIMI263
Helper I
Helper I

Patch a datepicker value to a SPO date Column

I need some help........

 

I'm struggling with a patch function. I tried almost everything, but I keep on seeing red lines. 
The field I try to patch is a datepicker. (datepDatum). 

The SPO column is a date and time field.

The error massage I see are like this.

Invalid argument type (Control). A Text value is expected instead.

The type of this date argument does not match the expected Record type. Type Date found.

The Patch function only has invalid arguments

What I understand is that there is a conflict between Text and Datevalue. But how can I change this,
See picture below.

Datevalue.png

 

Thanks from the Netherlands

Steven
 

1 ACCEPTED SOLUTION

Accepted Solutions

@StevenTIMI263 

I made a quick test in my environment, trying to patch a date from a DatePicker control to a SharePoint "Date and time" field.
You should be able to use the formula below:

Patch(Sessies, ThisItem, {Datum: datepDatum.SelectedDate})

Just make sure that the date column in your SPO list is name "Datum" and that its data type is "Date and time".

Also, I see that you're using [;] instead of [,].
I don't speak Dutch but the Patch function doc below does not seem to mention this syntax. Are you sure that this is appropriate?
De functie Patch - Power Apps | Microsoft Docs

View solution in original post

4 REPLIES 4
rsaikrishna
Super User
Super User

@StevenTIMI263 

 

Please give a try with following formula:

Patch(Sessies;ThisItem; {Datum: DateValue(Text(datepDatum.SelectedDate,DateTimeFormat.ShortDate))})

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

Sorry Krishna 😢
datep2.png

and this picture
datep3.png

 

Thanks for your quick replay. 

Kind regards
Steven

@StevenTIMI263 

I made a quick test in my environment, trying to patch a date from a DatePicker control to a SharePoint "Date and time" field.
You should be able to use the formula below:

Patch(Sessies, ThisItem, {Datum: datepDatum.SelectedDate})

Just make sure that the date column in your SPO list is name "Datum" and that its data type is "Date and time".

Also, I see that you're using [;] instead of [,].
I don't speak Dutch but the Patch function doc below does not seem to mention this syntax. Are you sure that this is appropriate?
De functie Patch - Power Apps | Microsoft Docs

Thanks. This solved my issue. In the Netherlands we use some different identifiers etc. 

,    is    ;   here.

 

Regards.

Steven  

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,307)