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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Filtering web API query by Optionset

(0) ShareShare
ReportReport
Posted on by 121

Hi, i wanna ask how to create filter in web api using optionset field.

i tried this but its not working.

	var Filter = "&$filter=_new_opportunityid_value eq " opti_id " and new_gradegroup/Value eq "  100000000 "";

I have the same question (0)
  • Verified answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    you don't need to write /Value when filtering optionsets, so in your example will be

    var Filter = "&$filter=_new_opportunityid_value eq "+opti_id+" and new_gradegroup eq 100000000";

  • Verified answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi, 

    As  mentioned by Guido Preite you don't need /Value. 

    You can easily generate your queries using fetchXml builder, please refer to the image below: 

    pastedimage1611153076828v1.png

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans