Using SharePoint List Choice field in PowerApps

Learn Expert

Hi all,

 

If you've tried to create a PowerApp that filters or searches on a choice field in a SharePoint list, you may have found that it doesn't work. This is because today, PowerApps expects the filtered/searched fields to be text fields.

I found a simple work-around for this by using a Calculated field in SharePoint for the choice field as PowerApps treats calculcated fields as text fields.  In the example below, the field I'm interested to search on is a choice field called bugStatus.  Instead, my PowerApp uses bugStatusValue in its search field.

 

Choice1.JPG

19 Replies

thanks for Shareing!

Can PowerApps write the value back to the Choice Field at all?

Maybe add a comment on the 'powerapps' user voice site. There are still large gaps between SP and 'powerapps' even though the public integration is being released this month.

I beleive at this time it is not possible.  

Thanks for sharing this tip.  It saved me some headache!

Works great , thanks for sharing

The other way I've found doing it, is using a new Entity within the CDM and use that as the choice field. When filed is updated in PowerApps, write the value back into SahrePoint Text Field.

Using the web editor I can't display a SharePoint Choice column on the browse screen.

I used the Calculated Column trick and it worked. 

And technically the CHOICE field IS TEXT...  What the HECK!

 

I also had to do the same trick to get the app to sort by date.

 

Thanks for the trick!

 

Append you field with .Value and It'll work.

 

CountRows(Filter(YourList, YourChoicefield.Value = "OK"))

 

 

Thanks

Thanks Raouf!

 

Just what I was looking for. This worked great! No need for an additional column.

I've tried both the ChoiceColumn.Value and Calculated Column alternative and both indeed work for me except I am getting the blue dot/blue squiggly line warning about delegation. As I understand it, it works in test now, but when the list grows over 500 records, it will break. So I need an alternative. The only one I can think of it to use a workflow to copy the Choice field into a text field in SharePoint and put an index on that field. That will certainly work and avoid delegation, but is smacks of a hack. Are there any other solutions? For those who need to see code to understand, this is the phrase that is causing the delegation issue for me. 

Filter('Store Task Template',Status.Value="Complete")

Curious if anyone has revisited this since December.  I tried the calculated column trick.  When I do it, I get the blue dot, PLUS the filter doesnt work!

 

Additionally, if you use the .VALUE trick, it just says invalid name, and doesnt even let you use it. 

 

Did something change?


@Deleted wrote:

I've tried both the ChoiceColumn.Value and Calculated Column alternative and both indeed work for me except I am getting the blue dot/blue squiggly line warning about delegation. As I understand it, it works in test now, but when the list grows over 500 records, it will break. So I need an alternative. The only one I can think of it to use a workflow to copy the Choice field into a text field in SharePoint and put an index on that field. That will certainly work and avoid delegation, but is smacks of a hack. Are there any other solutions? For those who need to see code to understand, this is the phrase that is causing the delegation issue for me. 

Filter('Store Task Template',Status.Value="Complete")

 

@rodney martin 

Yes, I just retested both methods (Filtering on a choice column as well as on the calculated column). No change. Both work and both display the blue dot and blue squiggle in the code indicating delegation issues. I cannot really put this app into production because I will hit 500 records in about 2 days, at this which, I would have egg on my face. 

 

All,

 

I recently have started to see this issue, again. I fixed it by using the calculated field trick, but my list got too long,and thus crashed it. Now, for another list, I am searching through an actual choice column; which somehow hasn't crashed, or thrown any errors. 

Has anybody got a better fix than random miracles?

I use a Flow to solve this. When item is updated I write the text value to a text field and then in PowerApps filter on the text field. It can mean a lot of Flow runs so watch your allocation. Also add another field for last updated by Flow and compare that to updated or you will get a looping Flow as the update will trigger the Flow again.

@Haniel Croitoru 

 

Hi what is the formula you used for your BugStatusValue field?

Hello All...

I solved it using .Selected.Value to check the text of the choice field.
 
My DataCardValue8 have 2 options ("Option Visible" and "Option not Visible"). If user choose Option Visible the code set the variable FieldOptionVisible = true Else it is false. Then I use the variable FieldOptionVisible in the visible property of the field FieldOption.
 
To do that in "OnChange" event of DataValueCard8 I put the code:
If(DataCardValue8.Selected.Value="Option Visible",Set(FieldOptionVisible,true),Set(FieldOptionVisible,false))
 
Hope it can help someone else.

@Anderson_BR Before I put the code on the "OnChange", do I need to something else? I have a choice column with dropdown menu (Yes, No) on Sharepoint list. I created an edit form based on this list but the dropdown menu didn't work. Any helps are appreciated. Thank you.