REST query is turning additionalScope property object into "[object Object]"

I have a rest query in query the query library. I am calling it from JS like this:

const scope = {
  jobName: txtSTName.value,
  writer: writer, // try passing with object
  parsingFormat, // try passing ES6 style
  dateTime: + ' ' +,
  timeZone: "{ name: tz,  value: " + + "}" // try passing as string
let event = await restSTAddEvent.trigger({additionalScope: scope})

But this is what is what I am seeing in the console:

You can see the additionalScope looks correct. But the body propertyies that are themselves objects are getting converted to "[object Object]".

My query is pretty straighforward:

I tried parsing the string in my query:


But then the writer property just become a string "null":


Now I'm stumped, how do I pass an object as a JSON body property?

Hey Bradley! Is there a reason you're not parsing What is writer - a component or something else?


writer is simply a name/value pair {name: 'Karla', value: "email'} (see additionalScope in my screenshot of the console)

I did try parsing it (see last two screenshots), but it returns a null string. Maybe I am doing that wrong or in the wrong place?

Can you try and hover {{writer}} and show what you see there?

@jonathanbredo, thanks for being additional eyes on this!

I can't hover {{writer}} in the query since it is not defined until the query runs.

But I'll do you one better.

Here is my code (stripped of unneeded filler):

let additionalWriters = []
let writer = {name:[i].name,[i].st_username}
let parsingFormat = {name: st_parsingFormats().find(el=>[i].st_parse_format_value).name,[i].st_parse_format_value}

const scope = {
  jobName: txtSTName.value,
  writer: writer,
  dateTime: + ' ' +,
  timeZone: "{ name: tz,  value: " + + "}"


let event = await restSTAddEvent.trigger({additionalScope: scope})
if (event?.status != 'Scheduled') {
  utils.showNotification({title: 'Error',description: JSON.stringify(, notificationType:"error"})

Here is the json I am passing in additonalScope from that console.log():

    "jobName": "1589630b",
    "writer": {
        "name": "Karla Ray",
        "value": "karlaray@****.com"
    "parsingFormat": {
        "name": "Use writer's default/None",
        "value": ""
    "additionalWriters": [],
    "dateTime": "2023-01-12 10:30:00",
    "timeZone": "{ name: tz,  value: America/New_York}"

Yeah, I'm lost here... Best recommendation from me is to go over it with a Retool engineer over one of the office hours :sweat_smile:

1 Like

Update! Brad did indeed make it to office hours this morning :slight_smile:

Seems like using a Raw body should support different data types (not just strings). Waiting to see exactly what body format the API endpoint is expecting!

1 Like

I was unable to get it working at all. Retool doesn't like JSON objects when using a JSON body type and the API end point won't accept any Raw input configurations I can think to try.

So I fired up an Azure Function to act as an intermediary and that is working.

1 Like

Thanks for the update both!

Hello, I meet the same error. I post it here. [BUG] transport Object/Array from trigger additionalScope to query, the object/array will resolve to [object Object]