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
}
]
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
}
}
}
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 :
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
}
}
}
You just need to change the board ID for your board ID and the column IDs for your column IDs
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.
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:
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?