cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FelipePanza
Helper I
Helper I

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
Super User
Super User

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.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

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