Issue with create item and column_values

Hi all, I was using the api in bubble.io and can’t seem to edit the column values within the call.
Here is the POST call

{“query”:“mutation { create_item (board_id: 3188858191, group_id: “topics”, item_name: “”, column_values: “{“what_is_your_first_name_” : “value”}” ,) {id, name, column_values {id, title, value}}}”
}
if i remove the column_values section it works fine and if I make a separate call just to change an existing items columns, that works too but I can’t seem to get it to function when making a create_item call.

error message:
“message”: “Parse error on “what_is_your_first_name_” (STRING) at [1, 99]”,
“locations”: [
{
“line”: 1,
“column”: 99
}
]

Hello there @Buatcls!

I believe the issue may lie in the inner quotes not escaping the outer quotes.

Also, you need to use an item name.

Please try something like this and let me know what happens:

mutation {
  create_item(board_id: 3188858191, group_id: "topics", item_name: "Item Name", column_values: "{\"what_is_your_first_name_\" : \"value\"}") {
    id
    name
    column_values {
      id
      title
      value
    }
  }
}

Cheers,
Matias

1 Like

Thanks for the reply! I managed to make some headway but as I’m not too familiar with the curl language, having some trouble and I seem to need to use curl

I created this call:
{“query”:“mutation { create_item (board_id: 3188858191, group_id: "topics", item_name: "Name", column_values:"{\"text8\":\"Gender\"}") {id, name, column_values {id, title, value}}}”
}
}

Which works fine however when I try to make more than one change to the column values like in this example it doesn’t work :

{“query”:“mutation { create_item (board_id: 3188858191, group_id: "topics", item_name: "Name", column_values:"{\"text8\":\"Gender\"}, {\"what_is_your_first_name_\" : \"FName\"}") {id, name, column_values {id, title, value}}}”
}

Raw response for the API
Status code 500
{“error_message”:“809: unexpected token at ‘, {"what_is_your_first_name_" : "yom"}’”,“status_code”:500}

I’m using variables to input data which is why name is yom

Hello again,

It looks like you are closing your column_values object early. Also, you are trying to Something like this should work:

mutation {
  create_item(board_id: 3217125868, group_id: "topics", item_name: "Name", column_values: "{\"text8\":\"Gender\", \"what_is_your_first_name_\" : \"FName\"}") {
    id
    name
    column_values {
      id
      title
      value
    }
  }
}

it didn’t seem to work but I think its because the layout was different :

There was an issue setting up your call.

Raw response for the API
Status code 500
{}

Hello again @Buatcls !

I rechecked the mutation I sent and it works.

You just need to change the board ID for your board ID and the column IDs for your column IDs :slightly_smiling_face:

Check it in the Playground (go to your account, click on the left panel on your profile picture or initials, click on “Developers”, click on “Developer”, click on API Playground).

If it works there with your IDs, and it does not work in your script, then it is a syntax issue.

Hope this helps!

Cheers,
Matias

I see, I’ve had the most luck with curl and it seems that the html on this forum removes some of the syntax I did but essentially all the values and parameters that have \ next to them should have \ \ \ (no spaces) instead. The weirdest part is that this call:

{“query”:“mutation { create_item (board_id: 3188858191, group_id: "topics", item_name: "Name", column_values:"{\"text8\":\"Gender\"}") {id, name, column_values {id, title, value}}}”
}
}

actually works so is there something wrong with the syntax from this next one? All it adds is a new line within column values:

{\\\"text8\\\":\\\"<Gender>\\\", {\\\"what_is_your_first_name_\\\":\\\"<fname>\\\"}}

but I seem to get errors.

Raw response for the API 
Status code 500
{"error_message":"809: unexpected token at '{\"text8\":\"male\", {\"what_is_your_first_name_\":\"gui\"}}'","status_code":500}

is there something I am missing in terms of syntax with the full call?

{"query":"mutation { create_item ( board_id: 3188858191, group_id: \"topics\", item_name: \"<Name>\", column_values:\"{\\\"text8\\\":\\\"<Gender>\\\", {\\\"what_is_your_first_name_\\\":\\\"<fname>\\\"}}\") {id, name, column_values {id, title, value}}}"
}

Hello again,

The issue is that you are opening curly brackets were there are not supposed to be curly brackets.

Instead of this:

{"query":"mutation { create_item ( board_id: 3188858191, group_id: \"topics\", item_name: \"<Name>\", column_values:\"{\\\"text8\\\":\\\"<Gender>\\\", {\\\"what_is_your_first_name_\\\":\\\"<fname>\\\"}}\") {id, name, column_values {id, title, value}}}"
}

You should use this:

{"query":"mutation { create_item ( board_id: 3188858191, group_id: \"topics\", item_name: \"<Name>\", column_values:\"{\\\"text8\\\":\\\"<Gender>\\\", \\\"what_is_your_first_name_\\\":\\\"<fname>\\\"}\") {id, name, column_values {id, title, value}}}"
}

Perfect, this helped. Thank you very much

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