Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Filter for ComboBox items (options) and display choice column value

(0) ShareShare
ReportReport
Posted on by 37

Hello,

 

I have a gallery with a Combobox and I'm trying to get items (options) to display on this Combobox based on a value in "ThisItem"

 

I've tried many formulas without success.

 

-The Language field is a choice column

hackondor_0-1635870780891.png    

hackondor_1-1635870876463.png

 

Expected result:  ["en", "fr"...]

 

Thank you

  • PTBBSolutions Profile Picture
    PTBBSolutions 691 on at
    Re: Filter for ComboBox items (options)

    Hi @hackondor 

     

    Have in mind that Distinct is not deligable - not sure if this matters to you. My last suggestion will be to save+publish the app, close it and re-open it. Sometimes the comboboxes just bug.

     

    Let me know if this helps.

  • Verified answer
    hackondor Profile Picture
    hackondor 37 on at
    Re: Filter for ComboBox items (options)

    Finally found the solution from this article, thank you guys for your help:

     

    Distinct(Filter('TDS-Generated-Master', 'TDS-Generated-ID'=ThisItem.'TDS-Generated-ID'),Language.Value)

     

     

  • hackondor Profile Picture
    hackondor 37 on at
    Re: Filter for ComboBox items (options)

    @PTBBSolutions   a simple "single line of text" "text type" my data source is SharePoint and the formulas in my items for the gallery is:

     

    Filter('TDS-Generated-Master', Status.Value="Published")

  • PTBBSolutions Profile Picture
    PTBBSolutions 691 on at
    Re: Filter for ComboBox items (options)

    Hi @hackondor 

     

    What is  the data type of thisitem.TDS-Generated-ID coming from the source?

  • hackondor Profile Picture
    hackondor 37 on at
    Re: Filter for ComboBox items (options)

    The result is as expected but i have no result when I compare with ThisItem.TDS...

     

    as a workaround, I added a label text and I get the value from there, but my goal is to access the value in the record because language is a choice column and I can't add ".Value" at the end of the formula to get the value

     

    hackondor_0-1635874132517.png

     

  • PTBBSolutions Profile Picture
    PTBBSolutions 691 on at
    Re: Filter for ComboBox items (options)

    @hackondor 


    Could you please put thisitem.TDS-Generated-ID in a label control and see the output. Also insert another label and write "thisitem.TDS-Generated-ID = "[the manually copied string from your example]", and see if the result = true

  • hackondor Profile Picture
    hackondor 37 on at
    Re: Filter for ComboBox items (options)

    Hi @PTBBSolutions 

     

    When i filter by the current record like "ThisItem.'TDS-Generated-ID'" I have no error in the formulas but no result either with the message below:

    hackondor_0-1635872274318.png

     

    Once I change to the text (hardcoded value) for my filter function like "TDS-Generated-ID'="TDSGEN-68"" I get the expected result but I can't access the value because language is a choice column so get "record", see below:

     

    hackondor_1-1635872515735.png

     

    Regarding your question:  

     

    DisplayFields: ["Value"]

     

    SearchFields: ["Value"]

     

    Best

  • PTBBSolutions Profile Picture
    PTBBSolutions 691 on at
    Re: Filter for ComboBox items (options)

    What is the error which you get? Or the combobox is just empty?

     

    Please check if the Search Values and the Display Values of the combobox are referring to the correct name.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard