Take due date from last card in list and add it as due date (+7) to new card at end of list
Asked by MarcusKirsch:

Can I get the due date from the last item and then set the due date of a newly created card +7 days?


Answers:
author: milynnus
body: [@MarcusKirsch](/t5/user/viewprofilepage/user-id/4278142)

No sure whether this is what you want

```
when a card is added to list "Electrical", find a card titled "Last Card" in list "Control", 
post to url "https://40979.wayscript.io/butler/dates?registry=milynnus&module=duedate_from_card&api_key=<api_key>&token=<token>" 
with payload "{\"from_card_id\" : \"{foundcarddescription}\" , \"to_card_id\" : \"{triggercardidlong}\", \"bump\" : \"7\"}", 



![Screen Shot 2021-02-26 at 8.10.09 PM.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/132163i511C32D287B462F5/image-size/large?v=v2&px=999 "Screen Shot 2021-02-26 at 8.10.09 PM.jpg")and set the card's description to "{triggercardidlong}"
```

comments: author: MarcusKirsch
body: I think so...


author: Iain Dooley
body: [@MarcusKirsch](/t5/user/viewprofilepage/user-id/4278142) at what point do you want to run this command? Like do you want it to run weekly, or when a due date is set on the last card in a list? Something else?

comments: author: MarcusKirsch
body: I am runninga. calendly and wired calednly to trello. So through automate.io, I create a google cal based on the calendly (better features) and then I create Trello cards via automate.io for my trello board. One is the GO-LIVE card, and those are one week apart. So whenever a new thing comes in, I need to add a new card in the GO LIVE column one week after the last entry.

Make sense?


author: Iain Dooley
body: [@MarcusKirsch](/t5/user/viewprofilepage/user-id/4278142) well, if you're creating a card via automate.io and setting a due date on it, you could trigger when a due date is set on a card in the list where the cards are created, then you could copy the card and move the due date on the copy:

![2021-02-26 at 11.19 pm.png](https://community.atlassian.com/t5/image/serverpage/image-id/132164i83456F4020DD84B1/image-size/large?v=v2&px=999 "2021-02-26 at 11.19 pm.png")


author: MarcusKirsch
body: Cant as I need to use the last date of the last item in the GO LIVE list. The date when card is created is random or any time. The due date in the GO LIVE list is the static or reference point.  
So essentially ANYTIME I add a new GO LIVE card, its should find its place in the queue based on the last list item.


author: Iain Dooley
body: [@MarcusKirsch](/t5/user/viewprofilepage/user-id/4278142) but instead of creating the GO LIVE card via automate.io, you could just create the first one then copy it to each list and modify the copies however you need to, and move the due date accordingly.


author: milynnus
body: [@MarcusKirsch](/t5/user/viewprofilepage/user-id/4278142)

This is a requirement asked by several people. While you can use Butler to adjust due dates, it does not accept a date variable. It can use a CF but my cases, that just does not work as well. I have Butler add on which I am make it easier to use without registration so if you need it do reach out to me (see my profile)

comments: author: milynnus
body: [@MarcusKirsch](/t5/user/viewprofilepage/user-id/4278142)

This is the link to the public board for the add-on. More modules will be ported over.

<https://trello.com/b/POqPZOwG/just-a-butler-add-on>

The is the module <https://trello.com/c/h9QvOF0R/1-due-date-from-card>

Use it with

```
when a due date is set on a card in list "?? Cold", set due in 7 days
```


author: MarcusKirsch
body: Looks complicated, i have no idea what you are asking me to do.


author: milynnus
body: [@MarcusKirsch](/t5/user/viewprofilepage/user-id/4278142)

I understand.

Basically it uses Butler Http Request to call an endpoint. The simplest scenario is you want to set the due date card B using the due date in A but add 7 days then you so something like :

1. Trigger set on some condition such that card A gets triggered

2. Lookup Card B

3. Issue Http Request using

URL :

[https://40979.wayscript.io/butler/date?registry=MarcusKirsch](https://40979.wayscript.io/butler/date?registry=)\&module=duedate_from_card\&api_key=1234567890\&token=9876543219876544

(using fake api_key and token)

**POST**

Payload :

{ "from_card_id" : "{triggercardidlong}" , "to_card_id" : "{foundcardidlong}"}

Butler will pickup the card_id of A and B and send it to the endpoint for processing.

This will set the due date for card B = card A which will trigger the add 7 days.


author: milynnus
body: [@MarcusKirsch](/t5/user/viewprofilepage/user-id/4278142)

As you have tried, you would have found that you cannot use the due date of one card and use it to set the due date of a second card.

There are two other options (1) using CF (2) where date is part of name of a card when it is created...whether it works for you will depend on what you want to do.

Also reading your original post, you will have difficulty in find the last card in a list. I don't report butler having that capability. Just like you cannot get Butler to tell you fnext incomplete item in a checklist. These are very unique requirements.