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

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
Highlighted
Community Support
Community Support

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
Highlighted
Community Support
Community Support

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,040)