HTTP Request JSON Body

Hello Everyone,
I’am quite new with n8n, and facing a problem which maybe is only an understanding problem.
I need to send an JSON Body whithin an HTTP POST request. Trying to set up the JSON Body, I tried this

As you can see, there is “Object” before the JSON data i want to insert in “QueryDetails”.

The correct body should look like this:

{"QueryDetails":{"Constrid":32,"Constrainttype":"Q","Constraintname":"SUCHE1","Objecttype":21,"Constritems":[{"Andor":0,"Field":-101,"Operator":"=","Position":0,"Value":"*"}]},"ResultSortConditions":[],"PageNumber":0,"PageSize":"25"}

Maybe some of you could light me up a little how to archive this.

The data I refer to is:

[
{
"SkipIfWfExists": true,
"name": "SUCHE1",
"Workflow": "WF_TEST",
"Usersandqueriesid": 2,
"Userid": 1,
"Queryid": 32,
"Querytype": "Q",
"Workflowmodelid": 10002,
"Workflowmodelguid": "96129da02a5f4dfa967f8532ccb28f71",
"Systemreference": 1,
"Workflowmodelversion": 1,
"Enabled": true,
"Displayname": "WF_TEST",
"Description": "",
"Category": "",
"Datecreated": "2021-02-10T13:52:50.0000000+01:00",
"Dateedited": "2021-02-10T15:26:01.0000000+01:00",
"Usercreated": 2,
"Useredited": 2,
"Createdusername": "Administrator"
"Editedusername": "Administrator",
"Workflowmodeltype": 0,
"Constraintname": "Neue erweiterte Suche",
"Objecttype": 21,
"Constrainttype": "Q",
"Constritems": [
{
"Constraintitemid": 42,
"Constr": 32,
"Position": 0,
"Andor": 0,
"Field": -101,
"Operator": "=",
"Value": "*"
}
],
"Constrstatus": 0,
"IsHierarchic": false,
"QueryDetails": {
"Constrid": 32,
"Constraintname": "SUCHE1",
"Objecttype": 21,
"Constritems": [
{
"Constraintitemid": 42,
"Constr": 32,
"Position": 0,
"Andor": 0,
"Field": -101,
"Operator": "=",
"Value": "*"
}
],
"ResultSortConditions": [
],
"PageNumber": 0,
"PageSize": 25
}
}, ...

Welcome to the community @Alexander_Berndt!

Can you please try to change {{$json["QueryDetails"]}} to {{ JSON.stringify($json["QueryDetails"]) }}

Hello Jan,
thank you so much! This solved my problem!

1 Like

Glad to hear! Have fun!