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 / Can't use use Choice C...
Power Apps
Answered

Can't use use Choice Columns in Search

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Community,

I want to be able to search the SP list for all the columns it has.

However, the search formula throws up an error while inputting Choice Column or People Column.

Please refer the screenshot and suggest a workaround.

Thanks

 

GauravG_1-1601545627856.png

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Please consider changing your Formula to the following:

    Search(
     AddColumns(BRD,
     "txtFunctioin", Function.Value
     ),
     TextInput1.Text,
     "Title",
     "Scope",
     "BusinessPurpose",
     "txtFunction"
    )

     

    I am not sure which columns are not text from your posting, but assuming that Function was a choice column.  If there are others, then just add them to the AddColumns function and then put the new column name in the Search.

     

    I hope this is helpful for you.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes Thank you so much.

    I'll try this by eod- and update your suggestion as "Accept as Solution"

    For now, can you please share why this issue exists for complex data types (Choice, People)

    And how does this solution work to circumvent that would help too!

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Sure - Search works ONLY on text columns.  Choice and People (and lookup and calculated) are all considered complex types.

    So, the solution here is to add a column to the results of the datasource and then assign the value of the complex type to it.  Then the new column is a text column and can be searched.

     

    Also an FYI - if you plan to use the record of the Gallery for any other purposes and then submit back through an EditForm or other action, you will want to remove the column from the gallery.  As in this formula:

    DropColumns(
     Search(
     AddColumns(BRD,
     "txtFunction", Function.Value
     ),
     TextInput1.Text,
     "Title",
     "Scope",
     "BusinessPurpose",
     "txtFunction"
     ),
     "txtFunction"
    )

     This will actually do three things - first it adds the txtFunction column and assigns the complex column "Function" value to the column.  It then Searches the results of that (including the txtFunction added column), then it removes the txtFunction column (as it is no longer needed) and ultimately returns the combined results.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes You were spot on with this drop column thing being needed too as without that i started seeing an error "Invalid formula" for Item property being Gallery1.Selected saying expected a value compatible with 'DataSource'.

    I did not understand fully but seemed like the back-end table "BRD" got modified and detail screen could not handle that and so we had to delete this added column.

    Can you please suggest why it could not handle this change and made it mandatory for us to drop the column?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Signatures of records MUST always match in PowerApps.  So, if you add a column to a Gallery and then have an EditForm, for example, that derives its Item signature from that Gallery, but uses the core datasource of the Gallery (without the added column), then it will not be compatible.  The trick is to remove the column so that the Gallery no longer has it in its signature.  You can add as many columns in your Items of the Gallery in order to serve the purpose of filtering, searching, calculating, etc., but if you have other areas that derive from it, then you have to drop them - or change their derivation to another method (for example, instead of referencing Galleryx.Selected, you would LookUp(datasource, ID=Galleryx.Selected.ID)

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard