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 / Incompatible data type...
Power Apps
Answered

Incompatible data type in gallery filter

(2) ShareShare
ReportReport
Posted on by 104

hiya, 

 

I've  a gallery with few different drop downs and a search txt box. and i was getting this eror on the choice fields. any suggestions?

 

Search(Filter(
Products,
IsBlank(ddCategory.Selected.Value) || ProductCategory = ddCategory.Selected.Value),
txtSearch.Text, "ds_productname"
)

 

 

filtererrorpowerapps.png
Categories:
I have the same question (0)
  • M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @daniellemaree85 ,

    Try This if ProductCategory is choice column 

    Search(
     Filter(
     Products,
     ddCategory.Selected.Value = "" || ProductCategory.Value = ddCategory.Selected.Value
     ),
     txtSearch.Text, 
     "ds_productname"
    )

    ____________________________________________________________________________________________________________________________

    If my post helped, please mark it as Accept as solution to help others find it. A Thumbs Up would also be appreciated if you found it useful. 

    Warm regards,
    Muhammad Ali

     

     

  • Pro_User_365 Profile Picture
    546 on at

    Hi @daniellemaree85 ,

    The error you're seeing in the formula within your PowerApps gallery is due to a data type mismatch. In PowerApps, the OptionSet data type cannot be directly compared with text, which is likely the data type of ddCategory.Selected.Value. Here's how you can resolve this:

    If ProductCategory is an OptionSet, you need to compare it with the numeric value of the selected item in the dropdown, not the text value. Here’s a corrected version of your formula:

    Search(
     Filter(
     Products,
     IsBlank(ddCategory.Selected.Value) || ProductCategory.Value = ddCategory.Selected.Value
     ),
     txtSearch.Text,
     "ds_productname"
    )

    In this revised formula, ProductCategory.Value is used to compare the selected value's text to the text of the OptionSet. Ensure that ProductCategory.Value is the correct property that holds the text for your OptionSet.

    If you are still facing issues, you might need to use LookUp to get the correct value from the OptionSet based on the selected dropdown value.

    Best regards,

  • daniellemaree85 Profile Picture
    104 on at

    hi @M_Ali_SZ365 @Pro_User_365 

     

    product category is a choice column in dataverse i created as along with the other dropdowns. 

     

    i tried the suggestion   ProductCategory.Value but this is causing an error still, wanting to select one of the drop down options and not use the word value. 

     

    if you have any suggestions on how to do this on a gallery with multiple dd filters, happy for a suggestion 🙂

     

     

  • Verified answer
    Pro_User_365 Profile Picture
    546 on at

    Hello,

    The error you are experiencing is due to the incorrect usage of the `.Value` property on a Choice column in Dataverse when used within PowerApps. When dealing with Choice columns, you should reference the `.Value` of the selected item directly, without needing to specify `.Value` after the column name.

    Here's a revised formula you can try for your gallery items property:

    Search(
    Filter(
    Products,
    IsBlank(ddCategory.Selected.Value) || ddCategory.Selected.Value = ProductCategory.'Name of the Value Column in Dataverse'
    ),
    txtSearch.Text,
    "ds_productname"
    )


    ```

    In the above formula, replace `'Name of the Value Column in Dataverse'` with the actual name of the column that stores the text value of your choice in the Dataverse table.

    This should correct the mismatch error and allow you to filter the gallery based on the selected dropdown value.

    Best regards.

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 342 Most Valuable Professional

#2
11manish Profile Picture

11manish 234

#3
Valantis Profile Picture

Valantis 187

Last 30 days Overall leaderboard