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

JsonObject with Square Brackets

(0) ShareShare
ReportReport
Posted on by 40

I'm working with an integration where i have to make some API-calls, and some of the filters on the API uses square brackets around their values (see picture)

pastedimage1673263317914v2.png

My problem is that i add this value to the JsonObject, naturally as a string or Code datatype - but once the parameter is surrounded by quotation, it stops working.
If i send "[12230001]" with quotation outside of the brackets, the API returns an error. How can i bypass this? Is there any other datatype that supports brackets that would not be wrapped in quotationmarks in a JsonObject?

I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    Microsoft Employee on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    I will open this up to the community in case they have something to add.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Square brackets in JSON means an array object, so I think you need to pass the data as follows:

    "projectIdFilter": ["12230001"]

  • andreas@protektit.no Profile Picture
    40 on at

    You are right, but how do i build a variable for the jsonObject, that takes the brackets [ ] without it being a string/code/text?

    This is what i have currently
    pastedimage1673860446011v1.png

    This ends up as "[ some number ]"
    Any tips on how it can end up as ["number"] with the brackets on the outside?

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,161 Moderator on at

    You should use the Json array data type as documented here:

    learn.microsoft.com/.../jsonarray-data-type

  • andreas@protektit.no Profile Picture
    40 on at

    Perfect, this is just what i wanted. Thanks for the replies!

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,960 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,084 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,047 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans