Hi.
So my idea is the following: whenever I create a new card (on my board about video games), I want to automatically fetch that game cover image and add it as an attachment (to then appear as the cover image of the card).
To realize this idea I am using a Game DB API and Butler to fetch that cover image and then add it as an attachment.
This is my current Butler workflow:
My issue here is with the second POST. I have made several tests and came to the conclusion that the issue is with using a variable inside curly brackets like it is happening in the POST header: { "client-id": "???", "authorization": "Bearer {httpresponse.access_token}" }
On my tests, I also tried adding a comment with the following format "{ {httpresponse.access_token} }" and it saved with exactly that text (i.e. did not replace the variable with its value). But if I used "{httpresponse.access_token}" then it worked correctly.
My question is then: is there a way to use variables inside curly brackets in Butler commands?
Thank you!
To whomever finds himself in the same predicament as me, I leave the solution that worked for me that was achieved with the help from the Trello Support team.
Basically, it is not possible to use the `httpresponse` variable inside a JSON object (i.e. inside curly brackets) due to the way that the variable is handled (tip: has to do with regex parsing).
So the solution is to store the value that will be used inside a JSON object in another place, like a Custom Field or the card description and then use THAT variable inside the JSON object.
And that's it.
In my case, after I received the response from the first POST, I stored the {httpresponse.access_token} variable value in the card description and then for the second POST I used the card description variable to fill the header, like so: { "client-id": "???", "authorization": "Bearer {carddescription}" }
This is the flow:
Best regards!
Hi @Soumyadeep Mandal ,
Just to clarify, that is only one rule but with several actions on it.
I did it that way to test the behaviour of the `httpresponse` variable (and consequentially, also with the `cardname` variable).
Anyway, I will try contacting Trello Support by using the link that you provided.
Thank you for all your support with this. I really appreciate it :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Happy New Year, @Soumyadeep Mandal !
As for the issue, I have recreated again the rule and it still has the same behaviour! Unfortunately :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Plutin ,
Wish you a very Happy New Year!
I think you have misspelled or made the wrong rule!
Delete the rules and recreate them! It was not a bug!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Plutin ,
Welcome to the community!
Please follow up this documentation https://help.trello.com/article/1157-variables
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the welcome. Glad to be here :)
Actually, I had already read that documentation. And all the others that are related to Butler (https://help.trello.com/category/1134-butler).
Unfortunately this specific case is not mentioned. Or atleast I did not find anything mentioning this particular case of using variables inside curly brackets.
But I have done some more tests and noticed something.
I have created the following Butler rule:
And when I create a new card on the board that is using this rule, it behaves like the following:
As can be seen, the issue does not occur when using the `cardname` variable but only with the `httpresponse` variable. Which makes me ponder that the issue may be with the `httpresponse` variable and not with all variables (as I was initially thinking). It may be a bug with that particular variable.
Can someone confirm that this is really a bug?
But if not, how can I make `httpresponse` work as `cardname` does?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.