web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SharePoint Lists - Pow...
Power Apps
Answered

SharePoint Lists - Powerapps won't search "Choice" Field?

(0) ShareShare
ReportReport
Posted on by

I have a very simple powerapps application which enables managers to enter some information into a SharePoint list.

 

In order to make it easy for them (and myself) I set up many of the columns as "Choice" fields which present a Dropdown box to the manager with the limited choices they have to populate the field (Example: Under the "Locations" column they can choose North, South, East or West). They cannot add other choices.

 

Now, in the Powerapp itself, when I go to set some search functionality in the "Search" field at the top, Powerapps will not accept any of the Choice (dropdown) fields to search on.

 

This is the default forumula in the "Search" box, in the forumula bar, with the gallery selected and "Items" as the property choice:

 

SortByColumns(Filter('Safety Concentration Time Tasks', StartsWith(ComplianceAssetId, TextSearchBox1.Text)), "ComplianceAssetId", If(SortDescending1, Descending, Ascending))

 

My question is am I thinking about this the right way OR is there a forumla which will search those "choice" columns?

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    One thing to note is that complex field types (choice, lookup, date, metadata, person/group) aren't delegable in SharePoint, so if you have a larger list (>2000) you will have issues. If you have a smaller list then you might not have to worry about the blue dot warning you wil get when filtering or searching using a complex field if the performance isn't an issue because all the items from the list need to be pulled into PowerApps before the query can be executed.

     

    Example using the search box to search on locations

    SortByColumns(Filter('Safety Concentration Time Tasks', StartsWith(Locations.Value, TextSearchBox1.Text)), "ComplianceAssetId", If(SortDescending1, Descending, Ascending))

     

    Instead of a search box you could use drop downs to help filter the gallery.

    Example:

    ddLocations: drop down control will all the location values

    Gallery Items: SortByColumns(Filter('Safety Concentration Time Tasks', ddLocations.Selected.Value = Locations.Value), "ComplianceAssetId", If(SortDescending1, Descending, Ascending))

  • CP153319 Profile Picture
    on at

    Thank you! I just clued in that I was missing the .value after my location.

     

     

  • asri_zainal Profile Picture
    54 on at

    Seems like this solution works for the OP however what if one really need to perform a search in a text input for a choice field in sharepoint list, is this still possible?

     

    If yes, able to point me in to the direction on how to achieve this?

     

    - I have a choice field say "Departments" with various deparments as an option

    - in my powerapp, i have a text search input that allows users to be able to search by Name(string field), Department(Choice field)

    - At present I have to change the the "Department" field as string instead of choice field in order for the search function to work.

     

    Error: Wrong column type: Expects text type.

    Formula:

     

    Search('Sharepoint List', SearchBoxText.Text, "Name", "Department")

     

    I'm assuming some conversion from choice to string need to be done however I have no idea where to start.

  • StuartSmith Profile Picture
    225 on at

    Hi Asri, rather old thread, but did you even find a solution?

  • mattbGetz Profile Picture
    25 on at

    Hey Stuart,

     

    The way that I got around this was by using the AddColumns function to run a calculation on the non-text field and turning it into a new field that was a text item. Then I could use Search on the newly created field.

     

    AddColumns(myTable, "newColumn", PlainText(oldColumn.value))

  • RK1 Profile Picture
    14 on at

    Hey Matt,

    Where do you put this AddColumns function in regards to text function? I currently am trying to search a text and choice. I currently have the function:

    Search('Room 110 list',txtSearchbox.Text,"Title")

    which works, but I also want to add a choice column, so in theory, I'd want:

    Search('Room 110 list',txtSearchbox.Text,"Title"," Shop")

    Where Shop is a choice in my SharePoint. I think I need to use the function you mentioned "AddColumns" to this to make it work, if I understand you correctly

  • Australia Profile Picture
    387 on at

    Hi RK1, 

     

    Just wondering if you managed to get the AddColumn to work?

    I am also experiencing the same error of trying to search values from a Choice column in SharePoint.

    I would be very grateful if you could shed some light.

     

    Thank you.

  • RK1 Profile Picture
    14 on at

    Hi,

     

    No, I didn't get it to work, but I ended up changing to a text type column, but I used a drop down style input in powerapps to turn the text into a "Choice" kind of . Does that make sense?

  • Australia Profile Picture
    387 on at

    Hi RK1,

    Thanks for replying.

    You may wish to visit this thread I just posted: https://powerusers.microsoft.com/t5/Building-Power-Apps/SharePoint-Lists-Powerapps-won-t-search-quot-Choice-quot-Field/td-p/104473


    Hardit explained how to get AddColumns to work. 

     

    Hope it helps.

  • RK1 Profile Picture
    14 on at

    Thanks, I'll give it a look.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard