Hi there,
in an automation I use {cardname} and additional info for a new card title. Can I shorten the given text? Usually in APIs there is some functionality like for example {cardname|5} for the first 5 letters …
Cheers,
Torsten
It is worth familiarising yourself with the pattern matching functionality available in Trello:
https://support.atlassian.com/trello/docs/pattern-matching-and-wildcards/
using variables like {matchedtext}, {textbeforematch} and {textaftermatch} really help here...
Trello also supports RegEx so you can create more complex examples with that
For example, if you wanted to truncate the card name to 5 characters, the automation would be:
when the name of a card contains "regex:/^.{0,5}/", rename the card to {matchedtext}
@Daydreamer Mike thanks for the hint! But how do get a "when" condition inside my procedure?
My (fake) example (real thing is more complex):
- starts with click to a card button (let's say here on card "Very important Card")
→ find a special template card
→ copy that template card to list XYZ
→ rename title of template to "NEW: {triggercardname}"
→ result is a card "NEW: Very important Card"
But as title I only want "New: {first 10 letters from triggercardname}..." (so here "NEW: Very impor...").
I understand regex etc. but for that I would need some "when/if/..." inside my routine and I don't see that. If I just add a find (with cascade → find card contains "regex:/^.{0,5}/"), all my cards on the board would get changed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I solved it somehow with a workaround:
→ I created a new rule like "If a specific label is added to a card with name [here I added the RegEx that finds a very specific prefix and gives me the (shortened) part back that I need to rename the later card]" – then rename this card to [here I use the part from the RegEx]"
→ Then I changed the button I described earlier to rename the new card with a specific prefix to the whole name, also I add in the end the specific label, which then triggers the new rule.
So it creates first the card with the whole (long) name (like before) and is then automatically shortened by the new rule. The label is needed to trigger the RegEx-Search to get the part of the whole name. The prefix (in combination with the RegEx) makes sure that not a "normal" card is renamed when the label ist used by accident. I also added a comment with old name - new name, so if someone does trigger it by accident, it can be found and be reversed.
It would be so much easier if Trello would just support some basic template commands, like {triggercardname|5} would give back the first 5 letters of the name. :-)
Cheers,
Torsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the delay in replying, I have been travelling.
This is the area where you can use "when the name/description of a card contains..."
Regarding the variables, there is almost no chance of Trello making any changes to this so if you do want to do more in that area, it is worth learning around regex. It opens up so many possibilities.
Take a look at this article for guidance:
In that article @Krimo Khermane suggestion of using ChatGPT to formulate the regex query is a really useful tip
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.