cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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