Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

can't handle JSON returned by Trello API on JS

José_Chavez May 25, 2020

So I'm working on a simple .html file .

I'm making the query:

var toDo= Trello.get('/lists/5d3ef8543a911e79f63df8c0/cards');

And I'm calling:

console.log(toDo);

And I'm getting image.png

So my problem is that I need to acces the responseJSON atributte, and I dont know ho to do it.

I already tried with toDo.responseJSON but it returns 'undefined'

How can I handle this type of JSON?

1 answer

0 votes
Iain Dooley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 26, 2020

@José_Chavez in order to figure out the structure of a javascript object, you can use:

for(var key in toDo)
{
    console.log(key+" has value: "+object[key]);
}

What you will probably find is that responseJSON is actually the member of another key in the object, so you'll have to address it like toDo.somethingelse.responseJSON

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events