cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Patch Collection value into SharePoint Date/Time Field

Here is my scenario.

 

In my app I am patching a collection of items (multiple rows if viewed in a table) to a SharePoint list.    One of the fields is a date field.   When I patch the date (dpDate.SelectedDate) to the collection in the app, I think it's converting it to a text value.  

 

patchdate2.png

 

Currently when the collection is patched to SharePoint, the date is being patched to a text field.  If I try to patch the same date to a SP date/time field I get an error about it only finding a text value. 

 

patchdate1.pngNote in the image above, 'TestDate' is the newly created date/time field in my SP list.  Yes I refreshed my data source.

 

What do I need to do with my date in order to patch it to the SharePoint date/time field.  

 

@Shanescows 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Patch Collection value into SharePoint Date/Time Field

Hi @JR-BejeweledOne ,

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. If you save a Date value into a collection, the collection would recognize the corresponding column as Date type column rather than Text type column.

 

As an alternative solution, I think the DateValue function could achieve your needs, please consider modify your formula as below:

ForAll(
       HolidayCollection2,
       Patch(
             'Holiday List',
              Defaults('Holiday List'),
              {
                Holiday: HolidayCollection2[@Name],
                Country: HolidayCollection2[@Country],
                Region: HolidayCollection2[@Region],
                Date: HolidayCollection2[@Date],
                TestDate: DateValue(HolidayCollection2[@Date]),   // Modify formula here
                HalfDay: HolidayCollection2[@HalfDay],
                Status: HolidayCollection2[@Status]
              }
       )
)

In addition, please make sure you have specified all Required fields from your Holiday SP List within the '{}' part of the Patch function.

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Patch Collection value into SharePoint Date/Time Field

Hi @JR-BejeweledOne ,

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. If you save a Date value into a collection, the collection would recognize the corresponding column as Date type column rather than Text type column.

 

As an alternative solution, I think the DateValue function could achieve your needs, please consider modify your formula as below:

ForAll(
       HolidayCollection2,
       Patch(
             'Holiday List',
              Defaults('Holiday List'),
              {
                Holiday: HolidayCollection2[@Name],
                Country: HolidayCollection2[@Country],
                Region: HolidayCollection2[@Region],
                Date: HolidayCollection2[@Date],
                TestDate: DateValue(HolidayCollection2[@Date]),   // Modify formula here
                HalfDay: HolidayCollection2[@HalfDay],
                Status: HolidayCollection2[@Status]
              }
       )
)

In addition, please make sure you have specified all Required fields from your Holiday SP List within the '{}' part of the Patch function.

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,932)