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...
Answered

Understanding API Queries

(0) ShareShare
ReportReport
Posted on by

Hello

I am super confused about how to work an api query or page table. I understand how to get all of the data from my custom api page and query, but I am trying to have an input that will only get one row of the table. Right now, I am entering a No in the header (what material I want the information for). The code is below

pastedimage1655323281439v2.png

What do I need to do to filter this so I only get a specific input that is specified in the header???

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    99,502 Super User 2026 Season 1 on at

    Hi, If you want to filter the query results directly, you can use the DataItemTableFilter Property.

    More details: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-dataitemtablefilter-property

    For example:

    pastedimage1655339314009v1.png

    Hope this helps.

    Thanks.

    ZHU

  • Community Member Profile Picture
    on at

    That is extremely helpful! Do you know where the inputs go when calling a query? Like if I want to filter based on a variable that is being passed in the header? (ex. a specific item that is subject to change between calls)

  • Verified answer
    YUN ZHU Profile Picture
    99,502 Super User 2026 Season 1 on at

    Hi, If you read Query data in AL, you can use the following method to filter.

    Query.SetFilter(Any, Text [, Any,...]) Method: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/query/queryinstance-setfilter-method

    Query.SetRange(Any [, Any] [, Any]) Method: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/query/queryinstance-setrange-method

    For example,

    pastedimage1655422795648v2.png

    If you're in an API, this requires the API's filter method.

    For example,

    pastedimage1655422971539v3.png

    api.businesscentral.dynamics.com/.../VendorLedgerEntries?$filter=Vendor_No eq '20000'

    pastedimage1655423050222v4.png

    More details: https://yzhums.com/6117/#toc8 (please replace the single quotation marks)

    pastedimage1655423081873v5.png

    Hope this helps.

    Thanks.

    ZHU

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 March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,933 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,055 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 640 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans