Can I make an automation event with a "date" custom field in butler? (and pass that date further)
Asked by Antonis Vlachos:

Hi there,

What I am trying to achieve is: when a certain date in a "date" custom field is some days from due, to create a new card in a list.

I have set up a similar rule, but the only condition I can chose is "is set"

![Screenshot_6.png](/t5/image/serverpage/image-id/144256iE739EF599841947F/image-size/large?v=v2&px=999 "Screenshot_6.png")

What I want to achieve is to create a card automatically, when this condition is met and not when I set the field.

Is this going to work only when I manually update the field?  

Is there any other way I can make this automation to work with a custom field and not the card's due date?


Answers:
author: Antonis Vlachos
body: Meanwhile I contacted trello support and got this solution:  

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

I added the condition "card in a list X" so the rule doesn't loop when the custom date is applied on the new card (which would be in a different list).  
You can retrieve the value of the custom date via the variable

{customfieldvalue}

as it was used in the trigger.  
If the card needs to be created in the same list as the original card though, a loop will be detected and the rule will be stopped (but it should work nonetheless to create the card and set its due date).


author: Iain Dooley
body: [@Antonis Vlachos](/t5/user/viewprofilepage/user-id/3955264) So what you're looking for is a Due Date trigger that works on a custom field, rather than the Due Date.

That's not currently possible, but you can have several due date commands that take action at different times relative to a due date.

So for example, if the reason you want to do that is that you have a custom field called "Application Date" and 5 days before the Application Date you create a card called "Comlete the Application by {date}", then you have another field called "Review Submission" and 3 days before that is due, create a card called "Review Submission by {date}" then you could achieve the same thing by setting the card due to, say, the finalisation date of the task, then having several Due Date commands that create the required tasks with an offset relative to that one due date.

comments: author: Antonis Vlachos
body: Thanks for the input.

My other option is to create another card, and add due date that is exactly the same with the field.

Is this possible?

So i want to achieve this:

- When date field is added, make a new card that dues at the date that's been added to that field.

What about this?


author: Iain Dooley
body: [@Antonis Vlachos](/t5/user/viewprofilepage/user-id/3955264) yep:

![2021-05-26 at 10.17 am.png](https://community.atlassian.com/t5/image/serverpage/image-id/144816iC5B1869E17EB9EA5/image-size/large?v=v2&px=999 "2021-05-26 at 10.17 am.png")


author: Antonis Vlachos
body: I got to that point my self but...

How to do tell Butler to take the trigger card's field instead of the new card's field? How do you reference that inside the text area you are showing. That's my problem for now. Is there a solution you can provide?


author: Antonis Vlachos
body: ![Screenshot_1.png](https://community.atlassian.com/t5/image/serverpage/image-id/145066i5298072D98CF7312/image-size/large?v=v2&px=999 "Screenshot_1.png")


author: Iain Dooley
body: [@Antonis Vlachos](/t5/user/viewprofilepage/user-id/3955264) go to the Cascade tab and choose "look up" instead of "find", and look up card with link {triggercardlink}

All variables references will now go back to the trigger card, but actions will apply to the current subject.


author: Antonis Vlachos
body: Hello again. Can you please give me an example that for a setting of a date field to one card, a new card is created and has a due date the same with that field you entered in the first card.

What ever i am tring is not working.


author: Iain Dooley
body: [@Antonis Vlachos](/t5/user/viewprofilepage/user-id/3955264) can you show me the command you've created that uses a lookup and I'll see if I can recreate the problem


author: Antonis Vlachos
body: ![Screenshot_46.png](https://community.atlassian.com/t5/image/serverpage/image-id/145473iF32FB6CF8D409A98/image-size/large?v=v2&px=999 "Screenshot_46.png")![Screenshot_45.png](https://community.atlassian.com/t5/image/serverpage/image-id/145474i0F0F4BEFF63CB4D5/image-size/large?v=v2&px=999 "Screenshot_45.png")

a new card gets created, but it doen't have a due date...


author: Iain Dooley
body: [@Antonis Vlachos](/t5/user/viewprofilepage/user-id/3955264) you have a typo in your variable name, you've typed "{triggercarfdlink}" instead of "{triggercardlink}"


author: Antonis Vlachos
body: [@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112) You are right, but It's not working even with correct variable. I' ve tried it many times with different combinations.

I just made a board for this. Here is a video of that rule in action:

<https://trello-attachments.s3.amazonaws.com/60a8e37606470489e4205e91/60b48fdfa5bedf3301568b29/52acb481a2ea74d2bc93f8074b27b01a/2021-05-31_10-26-21.mp4>


author: Iain Dooley
body: [@Antonis Vlachos](/t5/user/viewprofilepage/user-id/3955264) Okay, yep I'd say this is definitely a bug. The custom field variables aren't re-assigned when looking up a card. So I created this automation:

when custom field "Due" is set to a date, create a new card with title "{triggercardname}" in list "Inbox", lookup a card with link "{triggercardlink}", and post comment "from: {foundcardname} field: {{%Mobile Number}} and {{%Due}}"

and although the variable {foundcardname} refers to the looked up card, the custom field variables refer to the card we just created and there doesn't seem to be any way to reference the custom fields on the found card.

I'd go and report this to Trello via trello.com/contact because they should fix it imho.

In the meantime, BenkoBot can help. This function will do what you want:

<https://gist.github.com/iaindooley/55e20a0cb6d4de36d8f101183346cba6>

You can automatically install it in the BenkoBot platform by clicking this link:

[Click to install the above code in BenkoBot](https://app.benkobot.com/addlistener?functionName=setDueBasedOnCustomField&eventType=changedCustomField&code=dmFyIGRhdGVmaWVsZG5hbWUgPSAiTXkgRGF0ZSBGaWVsZCI7Ly91cGRhdGUgdG8gdGhlIG5hbWUgb2YgeW91ciBhY3R1YWwgZmllbGQKdmFyIHRhcmdldF9saXN0ID0gIk15IExpc3QiOy8vdXBkYXRlIHRvIHRoZSBuYW1lIG9mIHlvdXIgYWN0dWFsIGxpc3QKCi8vLy9ET04nVCBFRElUIEJFTE9XIFRISVMgTElORS8vLy8KdmFyIGNoYW5nZWQgPSBuZXcgTm90aWZpY2F0aW9uKG5vdGlmaWNhdGlvbikuY2hhbmdlZEN1c3RvbUZpZWxkKCk7CgppZihjaGFuZ2VkLm5hbWUoKSA9PSBkYXRlZmllbGRuYW1lKQp7CiAgQ2FyZC5jcmVhdGUoCiAgICBjaGFuZ2VkLmNhcmQoKS5ib2FyZCgpLmxpc3QodGFyZ2V0X2xpc3QpLAogICAgIvCfk4UgIitjaGFuZ2VkLmNhcmQoKS5uYW1lKCkKICApLnNldER1ZShjaGFuZ2VkLnZhbHVlKCkpOwp9)

When you click that link:

1) Put in your API key and token (you can see our privacy policy on the page too)

2) Review the code, update the names of the date field and list at the top (case sensitive!)

3) Choose which board you want this to run on (you probably don't want it to run on all boards)

4) Store the listener

5) Enjoy!


author: Antonis Vlachos
body: [@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112) Hey, nice thing that BenkoBot. I tryied to see the pricing but couldn't. Is it free?


author: Iain Dooley
body: [@Antonis Vlachos](/t5/user/viewprofilepage/user-id/3955264) you get 10 free minutes to try it out, then it's $10/month which includes 5,000 minutes and 1 concurrent execution. If you need more you can buy more minutes and more concurrent executions.

That's in the Plans section, but you don't see it until you login :)


author: Hannah Humbert - Simpla Workflows
body: Maybe I'm misinterpreting the question, but I think that trigger would do what you want? For example, I want a card to be created in the "To do" list about 24 hours before a custom field is due.   
![Screenshot 2021-05-21 102449.png](https://community.atlassian.com/t5/image/serverpage/image-id/144278i8B0854E712C0B55D/image-size/large?v=v2&px=999 "Screenshot 2021-05-21 102449.png")  
In your case, you would switch out "hours" with "days", so that way the card is created X days before the custom due date.   

You might want a secondary action that says "and link the cards together" so you know what the newly created card relates to, or use a variable in the card title that references the original card.


author: Laura Holton _ACE Rotterdam_
body: Hi [@Antonis Vlachos](/t5/user/viewprofilepage/user-id/3955264) ?

Butler's automations on Trello offer some great capabilities however there are some features that are currently limited. To the extent you are looking to automate an action it unfortunately doesn't look possible at them moment, however I'd recommend raising it as a potential new feature/functionality for Butler.

You can find out more on submitting a feature request here \>\> <https://help.trello.com/article/724-submitting-feature-requests-for-trello>

I hope this helps but if you have any more questions just ask away ?

All the best,

Laura