cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JasonHough
Level: Powered On

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
egallis
Level 10

Re: SharePoint Choice Column in a PowerApp collection

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
KroonOfficeSol
Level 10

Re: SharePoint Choice Column in a PowerApp collection

@JasonHough 

 

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

 

Hope this helps.

 

Paul

JasonHough
Level: Powered On

Re: SharePoint Choice Column in a PowerApp collection

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 ? 

 

egallis
Level 10

Re: SharePoint Choice Column in a PowerApp collection

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

JasonHough
Level: Powered On

Re: SharePoint Choice Column in a PowerApp collection

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. 

egallis
Level 10

Re: SharePoint Choice Column in a PowerApp collection

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?

JasonHough
Level: Powered On

Re: SharePoint Choice Column in a PowerApp collection

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. 

 

egallis
Level 10

Re: SharePoint Choice Column in a PowerApp collection

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

JasonHough
Level: Powered On

Re: SharePoint Choice Column in a PowerApp collection

thanks alot... 


@egallis wrote:

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


 

Highlighted
egallis
Level 10

Re: SharePoint Choice Column in a PowerApp collection

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 201 members 5,032 guests
Please welcome our newest community members: