Issues with the Trello - Create New Card action

This topic was automatically generated from Slack. You can find the original thread here.

Paul : Hi all.

I ran into an issue today working with one of my workflows that feeds into Trello.

I am just using the provided Create New Card action for the Trello app, straight out of the box.

And I kept getting a 400 Error "Request failed with status code 400
invalid value for idList"

It was driving me insane. I tried so many things.
Then I realised that everything is POSTed to Trello as a query string in the URL, rather than in the post body?
I’m guessing there’s always going to be some limitations with this.

Anyway. The problem was a hash/pound (#) character in the string being posted as part of the Trello card’s description. As soon as I removed that everything worked fine.

So I somewhat crudely just used string.replace(/#/**g**, " "); to clean out the hash symbol from any strings and it works fine.

But now I’m curious about a few things:

  1. If other odd characters show up in strings, could they too cause issues?
  2. If yes to 1, is there a more robust approach to ‘cleaning’ the data I’m passing to the Trello Create Card step for better reliability?
  3. I’ve noticed in the past, sometimes my workflow breaks and has a Syntax Error due to things like Unexpected token , in JSON at position xxx. Which seems to again be associated with the data I am sending to the card. This could be related to 1 and 2. Any thoughts?
  4. If everything is being sent to Trello via the query string… is there a limit to that? Is it not better being POSTed as data in the body? Perhaps my understanding is off here.
    As I have solved my immediate issue - there is no hurry on this. Just curious for longer term hints, ideas or solutions.

As always, thank you for this awesome platform :pray:

Dylan Sather (Pipedream) : thanks for the detailed note. A few things:

• I pushed a fix for the Create New Card action that should address the core issue here. Try adding the action to your workflow (which should use the new version) and let me know if that works.
• Yes, Trello accepts data in the query string via a POST request (e.g. see the create a card Node.js example). It is non-standard.
• We’ve just shipped a completely new way of developing actions that bring new benefits (for example, they allow you to select params like the idList via a drop-down, instead of you having to provide the ID manually). Anyone can develop these actions. Would you be open to developing actions for Trello that replace the existing ones?

Paul : Hi Dylan,

Firstly, thank you so much for the super prompt assistance on this. The fix worked beautifully.

Second, I’ve looked at the new way of developing actions and while it seems initially beyond my novice skill set, I am always looking for opportunities to challenge myself and learn. So tackling this will be good for me. I will give it a try over the next few weeks.

Thanks again.
Paul