# What am I doing wrong?

**URL:** <https://community.fibery.io/t/what-am-i-doing-wrong/3080>\
**Category:** Get Help\
**Tags:** automations\
**Created:** [July 18, 2022, 7:03pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080 "2022-07-18T19:03:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [July 18, 2022, 7:03pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/1 "2022-07-18T19:03:54Z")

</div>

I want this Rule to set “Start Date” (which is working), and then set “Due Date” to be 7 days later, but “Due Date” is always empty after this Rule runs:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/d/d91b5596e7294779cdf42d7cb8a3dbb5ad735136.png)

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 18, 2022, 7:09pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/2 "2022-07-18T19:09:34Z")

</div>

The update action will update all fields simultaneously, so when `[Step 1 Task].[Start Date]` is used to update the Due Date, it will be whatever the Start Date value was before this action occurred.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 18, 2022, 7:10pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/3 "2022-07-18T19:10:57Z")

</div>

I suggest using the same formula used for Start Date but add 7 days to it.

UPDATE: see below, splitting into two actions will solve this

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [July 18, 2022, 7:27pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/4 "2022-07-18T19:27:44Z")

</div>

Apparently it’s worse than that…  
It appears that additionally, the results of “very recently run” Rules (i.e., those triggered “at the same time”) are also unavailable 🙁

This is making it very difficult to do the following via no-code:

1. Create a Button for the “Page” DB that creates and links five “Task” entities.
2. Use a “Task” Rule to set the Start Date of each newly-created Task to the “_most recently created Task’s_” Due Date, plus 7 days (that bit is always empty).

I’m trying to get the dates of these Task staggered – so each Task’s Start Date references the _previously-created_ task’s Due Date, something like:

```auto
[Step 1 Task].Page.Tasks.Sort([Creation Date], false).First().[Due Date] + Days(1)

```

But it appears that the “previously created” Task actually hasn’t been created yet when the Rule runs 🙁

**Maybe we could get a new Action for “Execute/commit previous Actions before continuing”?**

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 18, 2022, 8:16pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/5 "2022-07-18T20:16:47Z")

</div>

Based on what you describe, I wonder why you aren’t defining the Start and Due dates of the five Tasks at the time they are created (in the Page automation)?  
It would seem that there is complete determinisim, such that the values can each be calculated up front.

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [July 18, 2022, 11:04pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/6 "2022-07-18T23:04:03Z")

</div>

I would have rather done it the more compact way (one Rule instead of five set-field Actions), but it looks like it’s either your way or a script.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 19, 2022, 6:43am UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/7 "2022-07-19T06:43:27Z")

</div>

I don’t understand - doesn’t the way you have described above require two automations (a button and a rule)?  
I don’t know how your button is written, but I assumed it had 5 ‘create task’ actions anyway 🤔

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [July 19, 2022, 1:38pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/8 "2022-07-19T13:38:28Z")

</div>

Short explanation is, I was wanting to decouple the date-setting from the task creation, for other reasons - basically thinking ahead about wanting to do more date-fiddling on these tasks from other contexts as well. It’s minor, though.

Plus it irks my aesthetic sense to be duplicating formulas 😂

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 19, 2022, 2:36pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/9 "2022-07-19T14:36:02Z")

</div>

What does your first button automation look like?

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [July 19, 2022, 2:41pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/10 "2022-07-19T14:41:22Z")

</div>

The Button is pretty simple –

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/2/2a952696b5c048db1ff1175934ce909683507eac.png)

The “Dependent On” formulas each reference the Task created by the previous Action:

`[Step 1 Page].Tasks.Filter(Name = "WRITE " + [Step 1 Page].Name).Sort().First()`

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 19, 2022, 2:48pm UTC](https://community.fibery.io/t/what-am-i-doing-wrong/3080/11 "2022-07-19T14:48:12Z")

</div>

Assuming that you want each of these 4? 5? tasks to follow after each other (with Start Date 1 day after the previous Task’s Due Date, and Due Date 7 days after that), I don’t know why you would use this formula:

> [@Matt\_Blais](#):
>
> `[Step 1 Task].Page.Tasks.Sort([Creation Date], false).First().[Due Date] + Days(1)`

Wouldn’t it be better to use something like this?:

`[Step 1 Task].Page.Tasks.Sort([Due Date]).Last().[Due Date] + Days(1)`

Each of the Tasks will be created in order, and therefore a rule that looked like this should work:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/d/d3529dd4348e791e4c1ca6dfe5f8e485896acf4b.png)

Note: by splitting into two actions, the Start Date is available to be read when being used to define the Due Date.

(and you might need to have an if…then condition for defining the Start Date of the first Task to be created)
