Linked Cards with Templates: How do I move the linking structure when making a new board?
Asked by Ben Thoma:

I feel like this has a simple answer, but I can't seem to find it anywhere, so here it goes:

I've built a simple template with 5 cards in it. In my "top" card I have linked 4 other cards, so I can run a Butler automation that changes all of their due dates based on the date in the "top" card. In the template, it works great.

The problem comes in when I build a new board from this template. My new board has the "top" card still linked to the template's 4 cards, *not* the new board's 4 cards. It doesn't link to the new boards cards (perhaps because the links are via pasting a URL), but this breaks the purpose of the template.

I have to manually re-link each of the 4 cards to the new board's top card in order for my automation to be effective (and not change the dates on all of my template cards!)

So, how can I make the links relative to the board (instead of absolute to the template), so when I create a new board, the 4 linked cards are the ones in the new board, not the one from the template board?

Bonus points if you can answer this question, too: How do I ensure the same Butler automation is automatically checked (turned on) with my new board? Right now I have to manually turn on each rule, which also seems counter to the idea of creating a new board from a template.


Answers:
author: Vongsawat
body: You could make an "Initiate Board" Card Button that basically wires all the connections. Mostly via Find/Lookup by Name command to get around the "pasting by url" problem.  

Find the "top" card by name. Lookup the "firstitem" by name, add {foundcardlink} to checklist. Repeat for all "item" cards.  

If the Template Board is simple enough, might even be possible to cram the entire Template in to a Card Button haha. Something to ruminate on if I ever think about making Template Boards myself I suppose.

comments: author: Ben Thoma
body: Thanks [@Vongsawat](/t5/user/viewprofilepage/user-id/3989989) This worked best for me. I haven't tried creating and linking them with one card button, but that'll be next!


author: stew.johnson
body: [@Ben Thoma](/t5/user/viewprofilepage/user-id/3125307) [@Vongsawat](/t5/user/viewprofilepage/user-id/3989989) Hey guys, I have a similar issue to Ben but don't understand the "Initiate Board" Card Button solution proposed here that worked - can you explain in layman terms? I have a board template with 100+ card links that don't update when I copy to a new board (i.e. the new board links are to the template board cards as opposed to new board). Thanks in advance!


author: Vongsawat
body: [@stew.johnson](/t5/user/viewprofilepage/user-id/3026106) Oof, 100+ card links is a lot. The main Card Button solution only works for that one card with all the card links. If the card links are sprinkled all over the place, there are shenanigans you can do to get around it, but they depend on your card links having some sort of order. (technically manually coding everything also works but equates to multiple 100s of lines you have to input one by one..) and thats not even getting in to any of the Butler limits you start hitting, that might necessitate breaking it in to multiple chunks/buttons.  

That said, here's the Card Button solution for a single card:  

Lets say you have a CardA that has a checklist with card links to CardB and CardC  

Make a template board with CardA CardB CardC  

Make a Card Button that Creates a Checklist, Looks up a Card named CardB, adds {foundcardlink} to the checklist, Looks up a Card named CardC, adds {foundcardlink} to the checklist.  

Go to CardA, click the Card Button you made.  

[Here](https://help.trello.com/article/1157-variables) is where you can look up other such variables to use in Butler  
[This](https://help.trello.com/article/1193-butler-card-lookups) explains the difference between Find and Lookup, in case you are curious


author: stew.johnson
body: Thanks very much for your response! Much appreciated.


author: milynnus
body: [@Ben Thoma](/t5/user/viewprofilepage/user-id/3125307) learned this today

<https://community.atlassian.com/t5/Trello-questions/Can-a-date-in-a-list-name-set-the-due-date-in-the-list-cards/qaq-p/1447838>

Clever way to do the due date change for the 4 cards and card button if activated for new board will work there as well.

comments: author: Ben Thoma
body: [@milynnus](/t5/user/viewprofilepage/user-id/3947182) This almost does the trick for me. The issue I have is not that I want to move a date by a set number of days, but instead move dates relative to just one. So, creating a single button that has a fixed number of days (25 in that example) wouldn't work for me, as I need to move all dates relative to the change that occurred in just one.


author: Iain Dooley
body: [@Ben Thoma](/t5/user/viewprofilepage/user-id/3125307) @\[deleted\] here's a working example:

<https://gist.github.com/iaindooley/045f90b78b2db37f5f7f6a966551a290>

Just copy and paste that code here:

<https://app.benkobot.com/>

You can update the board to link to your own template, you can see how the sample is set up here:

<https://trello.com/b/lIXgjCeC/sample-linked-template>

You can also update the project name, if you just save that code snippet you can execute it in order to create a new board from your template.

You could also set this up with a "board of boards" approach, notification handling in BenkoBot is still in closed beta but you could use the same code in Google Apps Script:

<https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Introducing-Trellinator-Automate-Trello-with-Google-Apps-Script/ba-p/925271>


author: milynnus
body: Did you get any answer that works? I have the same issue with linked cards on a checklist on a template. When I create a new board from the template the list links are not updated. For me it means templates are pretty much useless, and that makes Trello pretty much useless to me as well. So an answer on how to fix this issue would be great.

comments: author: milynnus
body: @\[deleted\] At the gut of checklist item that links to a card is a URL string that happens to be recognised by a Trello. This text string is copied across "as is" when you create a new board with a template. I understand that having to ensure the setup including Butler before putting to use can be tedious. One way this can be overcome is to invest in a custom power up just for the checklist structure you want. I recognise this early when playing with Trello and Butler (bustled my quota in one hr learning Butler) check this out (no Butler) <https://youtu.be/TE1jPfkwako>


author: Iain Dooley
body: [@Ben Thoma](/t5/user/viewprofilepage/user-id/3125307) the way you want this to work, ie. without having to enable a bunch of rules on the new board but just have the copy "inherit" the functionality of the template, isn't possible with Butler. The process of relinking is also pretty cumbersome, but may be possible. You can do it with Trellinator, though; it's actually the example I use in the "something more ineresting" section of this introduction:

<https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Introducing-Trellinator-Automate-Trello-with-Google-Apps-Script/ba-p/925271>

Trellinator supports "global command groups", meaning that you can create a set of functionality once and then install it for a group of boards.

The code example in the article above doesn't deal with the template linking issue, but as [@Vongsawat](/t5/user/viewprofilepage/user-id/3989989) pointed out you can do this by looking up cards in the copied board by name on the new copy. Here's a modified version of the function in the article above that includes code that does this:

<https://gist.github.com/iaindooley/3eab9d28509538de591f0915b339dd70>