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...
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,111 Moderator on at

    Are you sure your json is formatted correctly ?

    Should not the lines be in an array ?

  • Angel CR Profile Picture
    10 on at

    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,111 Moderator on at

    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

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

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

    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

    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,111 Moderator on at

    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.

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,151

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans