cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Converting data types using Patch to a SharePoint list

I have a simple Patch function that writes the contents of a Collection ("DowntimeRecords") to a SharePoint list ("DowntimeDB"). I am having issues with converting data types to fit to write the Collection to the list. The problem is highlighted below:

 

ForAll(
DowntimeRecords,
Patch(
   DowntimeDB,
     {
       'Business Area': BusAreaColl,
       Country: CountryColl,
       Location: LocationColl,
       'Affected System': AffectedSystemColl,

       'Start Date': StartDateColl,

       'End Date': EndDateColl,

       TotalHoursNew: TotalHoursColl
      }
    )
);
Clear(DowntimeRecords);

 

Start Date and End Date are trying to write type Text to a Date type column in SharePoint, but won't allow it. TotalHoursNew is type Text trying to be written to a Number type column. I have researched how to solve this but I have not found the solution online. Any help with converting these Collection columns to the correct data type needed for the SharePoint list would be appreciated. 

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Converting data types using Patch to a SharePoint list

HI @Anonymous 

 

Can you please update your expression as:
ForAll(
DowntimeRecords,
Patch(
   DowntimeDB,
     {
       'Business Area': BusAreaColl,
       Country: CountryColl,
       Location: LocationColl,
       'Affected System': AffectedSystemColl,

       'Start Date': DateValue(StartDateColl),

       'End Date': DateValue(EndDateColl),

       TotalHoursNew: Value(TotalHoursColl)
      }
    )
);
Clear(DowntimeRecords);
This will do the conversions properly.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
 

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Converting data types using Patch to a SharePoint list

HI @Anonymous 

 

Can you please update your expression as:
ForAll(
DowntimeRecords,
Patch(
   DowntimeDB,
     {
       'Business Area': BusAreaColl,
       Country: CountryColl,
       Location: LocationColl,
       'Affected System': AffectedSystemColl,

       'Start Date': DateValue(StartDateColl),

       'End Date': DateValue(EndDateColl),

       TotalHoursNew: Value(TotalHoursColl)
      }
    )
);
Clear(DowntimeRecords);
This will do the conversions properly.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
 

View solution in original post

Anonymous
Not applicable

Re: Converting data types using Patch to a SharePoint list

Thank you @yashag2255! Exactly what I was looking for.

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 343 members 6,065 guests
Recent signins:
Please welcome our newest community members: