cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FelipePanza
Frequent Visitor

Create a collection from sharepoint list with choice column

Hi, I have searched for two day and tried all solutions I came over but I can't get it to work.

I have one Sharepoint list, from that list I want to create a collection from two columns.

Column 1 = Title = a text column contains name.

Column 2 = A choice column = text format, 3 possible choices.

 

I like the collection to look like this:

Column1 II Column 2

Name.     II text value

 

I tried this.

Clear(colInn);;ForAll(Sharepointlistname;Collect(colInn; {'Choice column name'.Value}))

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @FelipePanza,

to access the values within the nested table, you could use the "ForAll()" function:

ForAll(colList.MultiChoice,'Multi Choice'.Value)

This will create a table with only the values from your choice column:

Image 1.pngImage 2.png

If you want to check if the value exists in the collection, you can just add an "if()" function, if someone clicks on the button:

If(TextInput2.Text in ForAll(colList.MultiChoice,'Multi Choice'.Value),"true","false")

 

Hope this will help you!

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

3 REPLIES 3
MarvinBangert
Solution Sage
Solution Sage

Hi @FelipePanza 

you can just combine "ClearCollect" with "ShowColumns":

ClearCollect(collnn,ShowColumns(SharePointListName,"Column1","Column2"))

I hope this helps you!

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Thanks, the name for column2 had a space so that is was giving me problems. But as you can see inn the picture column 2 (here to the right) is a choice column and the value do not show. I want to use this collection to check if the personname exist before submit the new form. 

Skjermbilde 2021-04-05 kl. 16.31.37.png

Hi @FelipePanza,

to access the values within the nested table, you could use the "ForAll()" function:

ForAll(colList.MultiChoice,'Multi Choice'.Value)

This will create a table with only the values from your choice column:

Image 1.pngImage 2.png

If you want to check if the value exists in the collection, you can just add an "if()" function, if someone clicks on the button:

If(TextInput2.Text in ForAll(colList.MultiChoice,'Multi Choice'.Value),"true","false")

 

Hope this will help you!

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,762)