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

SharePoint Choice Column in a PowerApp collection

Hi, 

 

I have used : ClearCollect(v_col,'Strategic Objectives') to get a list called Strategic Objects into a collection called v_col. I need to grab the value of the choice columns in this collection so i can query over it. but when i look at the colleciton i get the 

 

Capture.PNG

logo. All this makes sense but i need the .value from this object - so i can query against it on all columns.

any ideas ? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Ok, so... As you can see on this capture from the Search() function documentation, you cannot use it to search through 'complex' data types such as choices columns.

Image 1.png

So, you have different solutions:

  1. you add a text column in your datasource and make sure it always gets the value from your choice column (then you will be able to search through this text column)
  2. you add a text column in your collection using the AddColumns() function in order to have a text column containing your choice column values; try something like this:
    AddColumns(ClearCollect(v_col, 'Strategic Objectives'),"Objective_Type_Text",Objective_Type.Value)
  3. you use the Filter() function to find all records in v_col that match your search:
    Filter(v_col, Objective_Type.Value="<your search value>")

Hope this helps,

Emmanuel

View solution in original post

10 REPLIES 10
Highlighted
Resident Rockstar
Resident Rockstar

@JasonHough 

 

Simple, you can drill down by using v_col.Editor.ValueYouWant

 

Hope this helps.

 

Paul

Highlighted

Thanks Paul, but this does not work. It does not get the value 

 

Search(v_col, "Yes", v_col.Objective_Type.Value) , the table looking icon is called Objective_Type and the value inside is called 'Value' and this does not work.. 

 

any ideas ? 

 

Highlighted

Hi @JasonHough,

A choice column is a table with one column called Value (but I assume you know that already).

What exactly are you trying to acheive ?

Are your trying to check if one of the records in your v_col collection has the "Yes" value in its Objective_Type choice column ?

If that is the case, try using the following formula:

LookUp(v_col, Objective_Type.Value="Yes")

Or maybe I did not quite understand your need.

Waiting for your feedback...

Emmanuel

Highlighted

I am trying to search on a collection and the first query is : 

 

Search(v_col, "Yes", "Check") and this is a normal column that is not 'grouped' or on a grid as such. 

and the other search is for a column that is set in a grid : 

Capture.PNG

There is only one piece of info in this that i need to search against.. I was looking at using 'Ungroup' in my clear collect statement which looks like this : 

 

ClearCollect(v_col,'Strategic Objectives' )

 

Thanks, JAson. 

Highlighted

Sorry @JasonHough, but I don't see what you mean by 'group' or 'ungroup'...

I thought your original goal was to search inside the choice column Objective_Type that is part of your collection v_col. Isn't that what you want to achieve?

Highlighted

thats absoutley correct.. I thought i could ungroup the objective_Type column when i do a clearcollect and I have tried this and it does not work. I am trying to search inside the column so i can use search to go through it. 

 

Highlighted

Ok... Since I've never done this give me a few minutes to sort it out...

Highlighted

thanks alot... 


@R3dKap wrote:

Ok... Since I've never done this give me a few minutes to sort it out...


 

Highlighted
Super User
Super User

Ok, so... As you can see on this capture from the Search() function documentation, you cannot use it to search through 'complex' data types such as choices columns.

Image 1.png

So, you have different solutions:

  1. you add a text column in your datasource and make sure it always gets the value from your choice column (then you will be able to search through this text column)
  2. you add a text column in your collection using the AddColumns() function in order to have a text column containing your choice column values; try something like this:
    AddColumns(ClearCollect(v_col, 'Strategic Objectives'),"Objective_Type_Text",Objective_Type.Value)
  3. you use the Filter() function to find all records in v_col that match your search:
    Filter(v_col, Objective_Type.Value="<your search value>")

Hope this helps,

Emmanuel

View solution in original post

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 (8,601)