dtbaker
dtbaker

Reputation: 4917

Store arbitary data against a card through the Trello API?

I would like to store some arbitary data against each card in the Trello API (at the moment only a single numerical value from 0 to 100, but if this works well then I'll shift more card-related data from my own app over to trello).

I cannot see anything like this available in the API docs, am I correct?

I may have to store a comment with json data in it against each card. Or maybe a better way?

Thanks!

Upvotes: 3

Views: 456

Answers (2)

Wade Wachs
Wade Wachs

Reputation: 111

Trello recently added the ability to store an arbitrary amount of labels on each card. These labels can either be color coded (which causes them to show up in the board display in Trello) or have no color (which causes them only to be displayed on the card detail display). For small amounts of arbitrary data (such as a single number as you described) this may be a reasonable option for you.

You can create the label and add it to a card in one call with:

POST /1/cards/[card id or shortlink]/labels

(reference - https://trello.com/docs/api/card/index.html#post-1-cards-card-id-or-shortlink-labels)

If you have a larger amount of data to store for which labels may not be sufficient, I would suggest adding a checklist to store your data. Checklist items that are marked as complete can be hidden in the interface. That could be helpful in making the UI a little cleaner with large amounts of data. If you use each checklist item as a separate data object, you could probably develop a very flexible data structure to store whatever you want.

For more detail on how to interact with checklists and checkitems you can read the documentation here - https://trello.com/docs/api/checklist/index.html

Upvotes: 0

xiaominglui
xiaominglui

Reputation: 349

In Trello, you can put string in card description, also, you can attach files below 10MB with a card, and there are also label, due time, comments etc. which you can map your data with. So your direction is right. That can achieve your goal. But, due to the available data type limitation in Trello. The cost in efficiency should be in heavy consideration.

Upvotes: 0

Related Questions