Add item by adding label
Asked by milene.langeslag:

We have the rule that when an item is added in a card in list A there will be automatically made a new card with the same title and label in a different list (B).

What I now want is when I create a new card in list B and give the card a label, this card will automatically added as an item in a card with the same label in list A.

Is there a rule to arrange this?


Answers:
author: Vongsawat
body: This might be prone to recursion, so want to check some details first. Only the first two questions are the ones that would change the solution massively.. hopefully I assumed correctly.  

Is there a single card in list A corresponding with each label (one-to-one relationship)? And are all these cards in list A already created? And are all the items linked items? Do you want the linked items in B to have attachments leading back to the checklist item (which would give the same result as if you had Convert the item to a linked card in the first Rule)? If so:  

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/102892i742C65EF56D14CB3/image-size/large?v=v2&px=999 "image.png")  
Replace the trello.com/c/xxxxxxxx link with the actual card url that corresponds with the label (click share on the card to see it)  

Also, the $ is to make sure the two rules don't recursively call each other. The only way that comes to mind at the moment, is to edit the first Rule so that it only triggers when you Create a new checklist item starting with $. I'm not sure which methodology you are using to create the card in List B, but suffice to say that you'd only rename it to {textaftermatch} after the label has already been applied. Or you could of course come up with a completely different way to avoid recursion.  

Hopefully I assumed your set-up correctly. If not, this solution as well as the following help files should be of some help. [Variables](https://help.trello.com/article/1157-variables) and [Lookup](https://help.trello.com/article/1193-butler-card-lookups).

comments: author: milene.langeslag
body: Yes in list A we have several cards, each with an own label. In list B we have several cards with a label from list A. List A and the labels already exists.

At this moment not all the cards are linked items. Do you want the linked items in B to have attachments leading back to the checklist item (which would give the same result as if you had Convert the item to a linked card in the first Rule: Thats's correct!

Is it a problemen that not all the cards are linked at this moment?


author: Vongsawat
body: Ah, no problem at all. I only asked so if you had said no, I'd have told you to remove the first command that adds a link (as an attachment)  

Huh, one of those rare cases where I actually did make all the right assumptions :)


author: milene.langeslag
body: I partly worked so I am already happy :)

The problem now is that in the item it shows the link and not the name of the card.

Also we have the rule when a item is made in the card in list A, automatically a card will be created in list B. So when I now made a card in list B the link is added in the card in list A, but it also created a new card.

![2020_07_16_11_41_51_Procesmanagement_Trello.png](https://community.atlassian.com/t5/image/serverpage/image-id/103200iFB4F55993608E7A9/image-size/large?v=v2&px=999 "2020_07_16_11_41_51_Procesmanagement_Trello.png")


author: Vongsawat
body: Refresh should update the link in to the card name. If not, screencap the link that won't change real quick for me?  

I did mention:  

\>Also, the $ is to make sure the two rules don't recursively call each other. The only way that comes to mind at the moment, is to edit the first Rule so that it only triggers when you Create a new checklist item starting with $. I'm not sure which methodology you are using to create the card in List B, but suffice to say that you'd only rename it to {textaftermatch} after the label has already been applied. Or you could of course come up with a completely different way to avoid recursion.  

That way the card created in B doesn't trigger the other rule. You rename it *after* you label it etc. Or do it in a completely different way. An alternative might be to apply a "Butlering" label to the card in List A, then remove it at the end. And have the other rule only trigger if the card *doesnt* have the Butlering label.  

Once you start doing semi-complex rules, you start having to find ways so they don't all chain together by accident  


author: milene.langeslag
body: We create cards from an item in list A and also by creating a card in list B and add the label. I tried to add the $ in either rules. The rule which makes a linked card is working but the new rule links the card to an item in the card in list A but because of the first rule it also creates a new card in list B. Is there anything I could do about this problem?

![2020_07_16_15_14_46_Procesmanagement_Trello.png](https://community.atlassian.com/t5/image/serverpage/image-id/103235iB752CB85EC8A3376/image-size/large?v=v2&px=999 "2020_07_16_15_14_46_Procesmanagement_Trello.png")


author: Vongsawat
body: Two ways, as previously outlined. More than once.  

When an item starting with "$" is added to checklist "Sub-Story" .....(then at the end).....Rename the card to {textaftermatch}  

Alternatively, you could use a Butlering label instead of "$" at the start of text to isolate the two Rules. Or even something else. So:  

\>When an item is added to checklist "Sub-story" of a card without the Butlering label, Add a Butlering label,..............Remove the Butlering label.  
\>When the green "Zel..." label is added to a card without the Butlering Label.....Add a Butlering label, add item {triggercardlink}, remove Butlering label.  

Essentially you need to look at commands that would otherwise trigger other rules (which happens once for each rule here) and find ways to make sure they don't trigger it. Which again, I have outlined two different ways you can do this.