Set due date w/ combining two custom fields
Asked by Jim Nichols:

* I am looking to have a custom field "Order Date" (this will be set to "now"
* I want to have another custom field "Weeks Out" (this will be a drop down of options "1-8"
* Then I would like to set the due date to be "Order Date" + "Weeks Out"

Having issues building this. I have tried " {{%Last Ordered}}+{{%Cycle}w} " to no avail.

What am I missinhg?

Thoughts?


Answers:
author: Dreamsuite Mike
body: Hi [@Jim Nichols](/t5/user/viewprofilepage/user-id/5426578)

This **can** be done but you need an additional custom date field:

```
When custom field Order Date is set in a card with custom field Weeks Out set to "{*}", set the custom field "Due Date" to {customfieldvalue+{wildcard1}w} and set the due date to the date in the custom field "Due Date"
```

As a bonus, you can also have this one so that your automation will work trigger in both instances that **Order Date** and **Weeks Out** are set:

```
When custom field Weeks Out is set to "{*}" in a card with custom field "Order Date" set, set the custom field "Due Date" to {{%Order Date+{wildcard1}w}} and set the due date to the date in the custom field "Due Date"
```


author: Maria
body: Hi [@Jim Nichols](/t5/user/viewprofilepage/user-id/5426578)

It's Mary from [Planyway calendar, timeline, time tracking for Trello](https://planyway.com/trello?utm_source=atlassiancommunity&utm_medium=referral&utm_campaign=atlassianquestions)

Let's break down the steps to achieve this and see where the issue might lie.

### 1. Setup Custom Fields {#toc-hId-2112353809}

First, ensure you have two custom fields set up:

* **Order Date**: This should be a date type custom field. You mentioned setting this to "now," which suggests you want the current date/time when the card is created or the field is set.
* **Weeks Out**: This should be a dropdown type custom field with options for 1-8 weeks.

### 2. Creating the Automation Rule {#toc-hId-304899346}

To calculate the due date based on these fields, you'll need to create a rule that triggers upon changes in these fields. However, it seems like the syntax you've tried might be slightly off, especially since Trello's date arithmetic syntax can be particular.

### The Correct Approach {#toc-hId--1502555117}

1. **Trigger**: The rule should trigger when either the "Order Date" is set or the "Weeks Out" field is changed.
2. **Action**: The action should calculate the due date based on the "Order Date" plus the number of weeks specified in "Weeks Out."

The correct format for date manipulation using custom fields wasn't clearly stated in your example. Here's a more detailed approach on how to set it up:

* **Rule Setup in Butler**: You need to create a command in Butler that listens to changes in the "Weeks Out" custom field (or the "Order Date" field, depending on your workflow) and then calculates the due date accordingly.

#### Example Rule {#toc-hId--811993643}

1. **Trigger**: "When custom field 'Weeks Out' is set on a card,"
2. **Action**: "set due date using variable {{%Order Date}} plus {{%Weeks Out}} weeks."

However, this exact syntax might not work directly due to how Butler handles date addition and custom fields. The correct syntax often depends on ensuring:

* The custom fields are correctly referenced by their names.
* Date addition syntax is correctly used according to Butler's documentation.


author: Alex W
body: Hi [@Jim Nichols](/t5/user/viewprofilepage/user-id/5426578) - welcome to the Community!

Unfortunately I do not believe it is possible to pass mathematical queries such as this in Trello's automation feature.


Tags: custom-field