Input Variable doesn't assign correctly in JSON body

I was able to get the source from binary file and convert into JSON (as image below, it’s merged and ready to be the input “Data” to to be my http request JSON body)
Kindly refer to my screenshot


#1 - An ARRAY of objects called “Data” is now act as my locations object
#2 - It’s successfully transfer to http request node as input, can see Data array is available with 2 location obj
#3 - safely use the markup {{ $json.Data }} and it’s resolved as 2 objects (marked as #4 in screenshot)

But i noticed an error soon, there is a missing array to encapsulate the two locations. Kindly advise what could be the possibly wrong? thanks

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

@weilies_chok , you can fix it by taking the whole JSON in the JSON body as an expression, that is

{{
  {
    "InterfaceCode": $json.InterfaceCode,
    "Data": $json.Data
  }
}}
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.