Bug in persons updates

Hi,

Just want to report what seems like a bug, and ask you to resolve it quick.

I’m trying to update the people column, and getting errors. I even tried using the api graph playground, with the mutation command copied directly from the documentation, and this is what I got (Other column updates worked fine thru the api playground):

mutation {
change_multiple_column_values(item_id:1889308806, board_id:1889308796, column_values: “{“people” : {“personsAndTeams”:[{“id”:2292943,“kind”:“person”}]}}”) {
id
}
}

SyntaxError: Unexpected token < in JSON at position 0

Hello @Msh,

Looks like you aren’t passing the right column values format for it to work. Try this:

mutation {
  change_multiple_column_values(item_id:1889308806, board_id:1889308796, column_values: "{\"people\" : {\"personsAndTeams\":[{\"id\":2292943,\"kind\":\"person\"}]}}") {
    id
  }
}

Tip: If you ever receive an error message like the SyntaxError above, open your browser developer console and paste in the column_values in JSON.parse() method. If you receive a parsing error, it means your formatting is wrong and you might receive a SyntaxError when you try running a mutation.
Here is an example:

JSON.parse("{\"people\" : {\"personsAndTeams\":[{\"id\":2292943,\"kind\":\"person\"}]}}")

Hope this helps

2 Likes

Hey @Msh ,

I agree with @kolaai here, it seems like you are missing the JSON escapes for the API playground. Most likely, this part of the documentation is somewhat confusing:

Great tip about JSON.parse in the console, @kolaai :slight_smile: Thanks for sharing that!

-Alex

1 Like

Hi,

I don’t know why my text appeared like it did (no slashes), maybe a “smart” copy-paste routine. Anyway, I actually ran the command exactly like kolaii suggested beforehand, with the slashes in place (and then again copy-pasted his text into the playground and ran it), and that is what was giving me the error.

@Msh

It seems like you are trying to use 2292943 as the User ID, but that User ID doesn’t exist within the account. After checking the logs, it seems like the User ID 22929493 should be used instead - would you be able to give that a shot?

-Alex

Embarrassing…but effective. I’ll take it :slightly_smiling_face:

Thanks so much.

Moshe

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