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 :
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
    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,105 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

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans