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 :
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,172 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
    IB-29041624-0 Profile Picture
    1,191 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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,454 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,806 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,538

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans