cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tg42q15f
New Member

Patch date and time Picker collection (offline) to SharePoint list (datetime format)

Hi,

My App works in offline mode. One of the forms has a picker date (date and time in separated fields) and stores in a temp Collection. When it's sync with server (internet connection) I'm trying to Patch coltempDate and coltempTime to SharePoint list (the single datetime field), but it's not working.

I tried lots of formats but it just store properly in SP if I Patch only the date: Patch(ListSP, {}, { 'Visit Date': DateValue(coltempDate) }.

What I need is to Patch this Colletion field "coltempDate" + "coltempTime" in SP datetime field.

Any help, pls?

1 ACCEPTED SOLUTION

Accepted Solutions

Now I realized the mistake... in the first Patch (get data from the PickerDate field) I shouldn't have separeted Date collection item from hour colletion item... I did the following inside the Patch:

tempDtVisita: DateValueDtVisita.SelectedDate + Time( Value(HourValueHrVisita.Selected.Value),
Value(HourValueHrVisita.Selected.Value), 0)

Now, in the Patch to sync all the data I just used SP_item: tempDtVisita, and worked perfeclty!

By the way... I was trying to complicate the simple :))

Thank you man!

View solution in original post

3 REPLIES 3
Sunil-Narnaware
Solution Supplier
Solution Supplier

@tg42q15f how are you capturing the values of date & time in coltempDate & coltempTime? and what is rationale behind using two separate collections?

Also you should be seeing an error DateValue(coltempDate) as it expects text value and not the table value..? can you check this as well?

Hi @Suni ,

In the "Save button" of the forms, I pick the date and time as follow:

Collect(colTemp, { tempDtVisita: DateValueDtVisita.SelectedDate, // date from datePicker

                             tempHrVisita: HourValueHrVisita.SelectedText, // hour from timePicker

                             tempHrMiVisita: MinuteValueMiVisita.SelectedText // minute from timePicker

                            }

Then I save it locally (SaveData function) and Load when there's connection. In the synch button I'm trying to get those temp items and Patch to the SP list which has the 'Visit Date' Datetime type. At this point, I only able to send the date without the hour and minute...

Now I realized the mistake... in the first Patch (get data from the PickerDate field) I shouldn't have separeted Date collection item from hour colletion item... I did the following inside the Patch:

tempDtVisita: DateValueDtVisita.SelectedDate + Time( Value(HourValueHrVisita.Selected.Value),
Value(HourValueHrVisita.Selected.Value), 0)

Now, in the Patch to sync all the data I just used SP_item: tempDtVisita, and worked perfeclty!

By the way... I was trying to complicate the simple :))

Thank you man!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (3,472)