cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sayalides
Helper III
Helper III

Patch multiple rows from a collection to SharePoint List

Hey Team,

I have a SharePoint list which has a column 'PolicyNamesAndURLs' which a multi line column. I want to patch data from my collection which has multiple rows. I want to patch all the rows of my collection [column PolicyURL] to my SharePoint column 'PolicyNamesAndURLs.How can I do that. I was trying this:

 

 

Patch('User Policy',Defaults('User Policy'),{HelpdeskRefNo:TC,
PolicyNamesAndURLs:ForAll(PolicyMappings,PolicyURL),
ReadAndAcceptedBy:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                        Claims:"i:0#.f|membership|"&User().Email,
                        Department:"",
                        DisplayName:User().FullName,
                        Email:User().Email,
                        JobTitle:"",
                        Picture:""},ReadAndAcceptedOn:Now()})

 

but I'm getting an error expected type Text found type Table. Please help me resolve this issue.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

HI @sayalides :

Could you tell me what PolicyURL's data type is?

I assume PolicyURL's data type is text.

Firstly,let me explain why you encounted this problem.

The point is data type.'Multiple lines of text' field only support text but the value of 'ForAll(PolicyMappings,PolicyURL)' is a table.

Secondly,I suggest you use Concat() to combine the PolicyURL in PolicyMappings into a string.Please try this formula:

Patch('User Policy',Defaults('User Policy'),{HelpdeskRefNo:TC,
PolicyNamesAndURLs:Concat(PolicyMappings,PolicyURL,Char(10)),
ReadAndAcceptedBy:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                        Claims:"i:0#.f|membership|"&User().Email,
                        Department:"",
                        DisplayName:User().FullName,
                        Email:User().Email,
                        JobTitle:"",
                        Picture:""},ReadAndAcceptedOn:Now()})

Best Regards,

Bof

 

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

HI @sayalides :

Could you tell me what PolicyURL's data type is?

I assume PolicyURL's data type is text.

Firstly,let me explain why you encounted this problem.

The point is data type.'Multiple lines of text' field only support text but the value of 'ForAll(PolicyMappings,PolicyURL)' is a table.

Secondly,I suggest you use Concat() to combine the PolicyURL in PolicyMappings into a string.Please try this formula:

Patch('User Policy',Defaults('User Policy'),{HelpdeskRefNo:TC,
PolicyNamesAndURLs:Concat(PolicyMappings,PolicyURL,Char(10)),
ReadAndAcceptedBy:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                        Claims:"i:0#.f|membership|"&User().Email,
                        Department:"",
                        DisplayName:User().FullName,
                        Email:User().Email,
                        JobTitle:"",
                        Picture:""},ReadAndAcceptedOn:Now()})

Best Regards,

Bof

 

View solution in original post

Hey @v-bofeng-msft ,

I have an issue I want to patch the PolicyNameAndURLs['Multiple lines of text'] using it's Alternative text. Like this:

PowerApps.png

When clicked on the AdminRightsPolicyV1 it takes us to that policy document. So, how can I patch it in this way. Please help me with this.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,971)