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

Community site session details

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

An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected

(0) ShareShare
ReportReport
Posted on by 10
Hello good day.

I have a problem when registering several lines to a central Business entity (General Ledger)

8004.png

this is the body of the json object
6355.PNG

but when I register only 1 line if it works well, the problem is when registering several lines, I am creating the service in this way.

0435.PNG

or how could I do to be able to register more than 1 line (5000 lines) in a single call
I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,035 Moderator on at
    RE: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected

    Angel CR 

    I added some code to git hub:

    https://github.com/ingebruvik/JsonToGLJournal

    This adds an action to your G/L Journal page and you can upload the json file into your journal.

    Then we can build from here and add the support for the Azure blog store.

    You can see if you are able to access the code on github.

  • Angel CR Profile Picture
    10 on at
    RE: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected

    this is the file

    [

      {

         "DIARIO_ORIGEN":"GENERAL",

         "DIARIO_LOTE":"GL-PL",

         "FECHA_CONTABILIZACION":"2022-03-04",

         "FECHA_EMISION":"2022-03-04",

         "Linea":1,

         "CUENTA_TIPO":"G/L Account",

         "CUENTA_NUMERO":"6211110",

         "DESCRIPCION":"PLLA REM RESGUARDO ENE 2022",

         "MONEDA_ID":"PEN",

         "MONTO":0.0,

         "MONTO_ORIG":0.0,

         "DEBITO":28350.97,

         "CREDITO":0.0,

         "ESTRUCTURA_CUENTA":"A1-CCOSTO|B1-CLIENTE|B2-CORPORACION|A2-DEDUCIBLE|A3-PLACA|C2-PLANILLA|B3-TORRE|C1-TRABAJADOR||",

         "ESTRUCTURA_VALOR":"RSG01.CS01|20522228347|CORP. ISEG PERU S.A.|SÍ|||GENERAL|"

      },

      {

         "DIARIO_ORIGEN":"GENERAL",

         "DIARIO_LOTE":"GL-PL",

         "FECHA_CONTABILIZACION":"2022-03-04",

         "FECHA_EMISION":"2022-03-04",

         "Linea":2,

         "CUENTA_TIPO":"G/L Account",

         "CUENTA_NUMERO":"6211130",

         "DESCRIPCION":"PLLA REM RESGUARDO ENE 2022",

         "MONEDA_ID":"PEN",

         "MONTO":0.0,

         "MONTO_ORIG":0.0,

         "DEBITO":15246.92,

         "CREDITO":0.0,

         "ESTRUCTURA_CUENTA":"A1-CCOSTO|B1-CLIENTE|B2-CORPORACION|A2-DEDUCIBLE|A3-PLACA|C2-PLANILLA|B3-TORRE|C1-TRABAJADOR||",

         "ESTRUCTURA_VALOR":"RSG01.CS01|20522228347|CORP. ISEG PERU S.A.|SÍ|||GENERAL|"

      }

    ]

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,035 Moderator on at
    RE: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected

    Yes i could do that if you could send a sample of your json file so i don't have to create those data myself.

    I can not copy it from an image :)

  • Angel CR Profile Picture
    10 on at
    RE: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected

    thank you, but could you share an example to guide me please

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,035 Moderator on at
    RE: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected

    Ahh, sorry i did not catch that you do this in an API page.

    Then you will have to send one line at the time.

    If you have a large amount of lines then you should do this another way.

    Either create a customized API that can take the full json load and handle it as a batch or store the json in an Azure blob storage and have BC read it from there.

    When i need to handle a large batch of lines i save the Json to Azure blob storage first.

  • Angel CR Profile Picture
    10 on at
    RE: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected

    Hello, good morning, in the last image you can see that it is inside a matrix, perhaps the service that has been created in Business Central does not support when multiple lines are sent?

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,035 Moderator on at
    RE: An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected

    Are you sure your json is formatted correctly ?

    Should not the lines be in an array ?

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,727

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,681 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 2,288 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans