Forum Discussion
Using SharePoint List Choice field in PowerApps
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.
- Raouf HarbegCopper Contributor
Append you field with .Value and It'll work.
CountRows(Filter(YourList, YourChoicefield.Value = "OK"))
Thanks
- Frederick GonzalesCopper Contributor
Thanks Raouf!
Just what I was looking for. This worked great! No need for an additional column.
- Deleted
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 martinCopper Contributor
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")
- Nice tip!!
- Deleted
thanks for Shareing!
- Deleted
Can PowerApps write the value back to the Choice Field at all?
- Craig DebboBrass ContributorMaybe 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.
- Haniel CroitoruLearn Expert
I beleive at this time it is not possible.
- Chad JohnstonCopper Contributor
Thanks for sharing this tip. It saved me some headache!
- Armando RomanCopper ContributorWorks great , thanks for sharing
- Scott MckenzieIron Contributor
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.
- Christopher FlorianIron Contributor
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!
- Deleted
- Anderson_BRCopper Contributor
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.- yoyop50Copper Contributor
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.