Automatic deadlines based on a main card
Asked by Ines Rosal:

Hello!  
I was wondering if it is possible to set automatic deadlines for multiple cards e.g. imagine that a card is due 10 days before the main date (main date=first day of the training) I would have one card with the main date that is the only one that would change then the others would update automatically if they are set 10 days before main date, 5 days before main date, 1 month before main date etc...  
I was then wondering if it is possible to have one card with one date as a reference (=1st day of the training) and then the others would update automatically to know when to do what quickly without having to add manually deadlines to all the cards


Answers:
author: Vongsawat
body: There's a couple of ways to do this. You might want to look in to [Applying Arithmetic to Date Variables](https://support.atlassian.com/trello/docs/arithmetic-and-formatting-in-date-variables/)

**Option 1: The brute-force method**Where the days-before quality is kept entirely in the automation:

When the due date is set on a card with the name "ReferenceDayCard", Find a card with link x (or named y) and set the due date to {triggercardduedate-10d}, Find a card with link x2 (or named y2) and set the due date to {triggercardduedate-5d}, Find...... etc.

Drawback is that there might be a limit to how many commands you can jam in to a single automation.. and that making any changes requires diving back in to the automation which is a pain.

**Option 2: Card with checklists of the different gaps, with multiple card buttons, method**Create a card specifically to manage this functionality. In it, have a Checklist called "10 Days Before" with all cards that are 10 days before, a Checklist called "5 Days Before" with all cards that are 5 days before, etc.

Then create multiple Card Buttons that essentially Lookup the "ReferenceDayCard", then for each card in Checklist "X Days Before", set the due date to {foundcardduedate-X}. Where X is different for each Card Button.

Then after setting the due date, you come to this card, and click all of the card buttons in a row.

The benefit here is in flexibility, in that you can move the cards between the checklists to change their relative due dates.

**Option 3: Option 2 but controlling the checklists through labels instead** Adds an extra step to option 2, such that you manually apply labels denoting the relative due dates. Then have a card button that collects all cards with such labels in to their specific checklists.

This means that you don't have to maintain a mess of checklists in that one card, and can add new cards over time and just add labels to them, without having to go update the centralized card. Essentially, decentralizing. With a different set of pitfalls of course.

**Option 4: Chained Rules to get the benefit of Options 1 and 2** Same as Option 2. Except instead of triggering them via card buttons, you have them trigger when a specific label is applied. "Compute 10 Day Due Dates" for example. With an additional step of immediately removing said label (so that it can be re-triggered later)

When the due date is set on a card with the name "ReferenceDayCard", Find a card with link x (or whatever you named the card with all the checklists), add the "Compute 10 Day Due Dates" label, add the "Compute 5 Day Due Dates", etc.

This is the most complex to set up. But what I'd probably do. Trying to add labels to this would probably be overkill.

*** ** * ** ***

Hope that helps. The main takeaways is that you likely want to trigger it off of when you change the due date of your main card (options 1 and 4). And that there's no (simple) way of applying different due dates in a single rule (except through brute force). Or, now that I think about it, through some hack-y way via custom fields. But that just adds to the complexity (and requires a paid account). I tried to keep it to just 4 options, as there're a lot more ways you could set it up, depending on how many cards you have, how many different relative due dates you have, how much flexibility you want, etc.


author: Dreamsuite Mike
body: Hi, [@Ines Rosal](/t5/user/viewprofilepage/user-id/5232364) this can be done via automation but it is something that'll take a little while to put together a guide so I will come back to this later today.