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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

BC Custom API — Boolean Filter Not Working on Synced Field

(3) ShareShare
ReportReport
Posted on by 213
Hi experts, I want to filter on a custom boolean field in the Purchase Orders custom API. I've made all the required setup to build a custom API for Purchase Orders — copied the base and added an API subscriber that syncs data between the Purchase tables and the API entity buffer. Everything is working fine, I've done it precisely.
But I'm running into trouble filtering all POs that are of type Subcontract. I have a boolean field for that. The boolean value is being returned correctly in the response, but when I try to add it to the filter, it returns empty even though I have 10 POs with the boolean set to true.

I tried adding quotes and other ways ,but it always returns empty.

I have the same question (0)
  • Yash_Mistry Profile Picture
    474 on at
    Can you share the Custom API page you've created in AL?
  • Suggested answer
    OussamaSabbouh Profile Picture
    15,188 Super User 2026 Season 1 on at
    Hello,
    For a Boolean in a Business Central API, the filter syntax itself should simply be $filter=isSubcontractPO eq true with no quotes around true, so your URL format is basically right. If it returns empty while the field is clearly in the payload, the usual issue is not the OData syntax but the API implementation: the field is being returned from your buffer, but the API page/table view that the filter runs against likely doesn’t have that value persisted or filterable the way you expect at query time. In short, BC can return a calculated/synced field in the response, but filtering only works reliably when the field is an actual field on the source record behind the API and populated before the read happens. So I’d first verify that the API source table/entity buffer itself contains true for those records before the GET runs, and that the field name in the API metadata is exactly isSubcontractPO. Also test directly in browser/Postman with a fully encoded URL, for example: ...?%24filter=isSubcontractPO%20eq%20true. If the data is only synchronized by subscriber after certain events, or not committed yet, the filter can return nothing even though unfiltered GET shows the value.
     
    Regards,
    Oussama Sabbouh
  • Suggested answer
    YUN ZHU Profile Picture
    100,212 Super User 2026 Season 1 on at
    Hi, hope the following helps.
    Microsoft REST API Guidelines
     
    Thanks.
    ZHU
  • Suggested answer
    Yi Yong Profile Picture
    2,704 Super User 2026 Season 1 on at
    Hello,
     
    The URL should work so it is likely the field issue.
     
    Is isSubcontractPO field a Boolean with Field Class = Flowfield?
     
    If yes, then you might need to change from Query type or Page Type for this API.
    Because Query will not calculate FlowField.
  • Gerardo Rentería García Profile Picture
    26,110 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Solved: Flowfield filters in api page

    API Query with flowfields

    Best Regards
    Gerardo

  • Suggested answer
    Aman Kakkar Profile Picture
    3,424 Super User 2026 Season 1 on at
    Hi,
     
    Try adding the filter in the Parameters tab, rather than on the URL itself (Try all of these four combinations of first letter uppercase lowercase, and True/Yes [True, true, Yes, yes] -
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,012 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 986 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 659 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans