Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Save a Collection to a Sharepoint List Column?

I have a Sharepoint List (myList) containing records captured from user input in a PowerApp.

The user inputs data into a PowerApp and that data is saved as a record for that user. I test the User().Email to validate and return that users record for edit/modification. This is not my problem though.

As my App has grown (user suggestions), I now include a method for the user to customize the App. The user selects various customizations and I store those customizations into a Collection within PowerApps (userSelections). This Collection has three Columns (role, val, state).

What I would like to do is save this Collection (userSelections) to a Column (SelectedWorkflow) in the users record in the Sharepoint List (myList). When a user returns, and after retreiving that users record, I would like to pull the userSelections Collection out of the SelectedWorkflow Column of their record, and then use that Collection to configure their Customizations.


The problem I am facing is in how to store a Collection directly into a Column in Sharepoint. The People Column type does this with PeoplePicker: saves a table of data to the column. I am missing something in trying to do this with a collection, and I cannot find a column type definition in Sharepoint List that holds table data. I hope I am just missing something simple.

Detail with code examples. Note: some code is redacted for simplicity.

Note: Each record in myList has many columns, including UserEmail, SelectedWorkflow, Modified, Etc., Etc., Etc..

On the App load, I create a master Collection (masterWF) with all of the Configuration options. This is hardcoded and not stored in any datasource. I configure this only if new Configuration options are requested.

        {val: "New Document", role: myRoles0.Role1, stat: 0},
        {val: "Start Workflow", role: myRoles0.Role1, stat: 0},
        {val: "Stop Workflow", role: myRoles0.Role1, stat: 0},
        {val: "Resume Workflow", role: myRoles0.Role1, stat: 0},
        {val: "Restart Workflow", role: myRoles0.Role1, stat: 0},
/*myRoles0 contains Role1, Role2, Role3, etc., each Role containing Text values,
but this is irrelevant to my question.
myRoles0.Role1 can be replaced with "Whatever".
I cut this masterWF list off after 5 values, but the actual list has 40+ values with
different Roles assigned. */


I load the masterWF in a Gallery (Gallery1_1) where the user selects values they want. I Filter the masterWF Collection values based on user selections made in the Gallery to create a new Collection (userSelections). The Gallery has a clickable Rectangle with OnSelect set to the following: 

If(IsEmpty(Filter( userSelections, role=ThisItem.role And val=ThisItem.val )),
	Collect( userSelections, ThisItem ),
	Remove( userSelections, ThisItem )


This is where my problem is: 

A "Save Configuration" Button saves "should save" the userSelections Collection to the SelectedWorkflow Column in myList.


The Configuration Screen OnVisible has the following:

ClearCollect(userSelections, Filter(myList, User().Email in UserEmail).SelectedWorkflow)
/* Where User().Email is compared to the stored value in the users record in the UserEmail column */


This should populate the userSelection Collection so I can apply their Configuration to the App. My problem is with the "Save Configuration" patch and me not knowing how to get the userSelections Collection to save into the SelectedWorkflow Column in myList.

My workaround is to use ForAll and Concat to turn the values in the userSelections Collection into a string. Save the string to the Sharepoint List. Load the string from the Sharepoint list, and then Split the string into a Collection. I want to avoid this headache if possible.

Can anyone tell me how to Save a Collection to a Sharepoint List Column? Or if this is possible?


Thank you!


Resolver II
Resolver II

I don't have the anwer to your specific question but if I can point out how I deal with user prefrences maybe it will help.

I create a seperate list or table with the all columns of user prefrences for your app as well as user email and on the app's OnStart I load the users prefrences into a collaction and assign them into variables and use them in the app. When the preferences change I write them back to the list or table.


This method has worked well for me and it's simple and easy to maintain.
If this post helps answer your question, please click on
“Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,071)