# Using an automation's step 1 data without a formula?

**URL:** <https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622>\
**Category:** Get Help\
**Created:** [January 4, 2024, 1:27am UTC](https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622 "2024-01-04T01:27:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![interr0bangr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/interr0bangr/32/8089_2.png) [@interr0bangr](https://community.fibery.io/u/interr0bangr)\
**Post date:** [January 4, 2024, 1:27am UTC](https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622/1 "2024-01-04T01:27:11Z")

</div>

If formulas were available within filters, the following automation would be very easy to get working, but in reality, I’m stumped.

 ![remove_point_log](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/2/2eba9002423631b6fc5bd870fcb11a6afeef4585.jpeg)

Is there an way to use the results of step 1 in any other way than a formula?

I want to delete this point log if the user it’s linked to is the same user who was just unliked from the task.

Relationships:  
Point Log (M to 1) User  
Point Log (M to 1) Task  
Task (M to M) Assignee

---

<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:** [January 4, 2024, 3:02am UTC](https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622/2 "2024-01-04T03:02:58Z")

</div>

Currently I think you would need to use a script to do this.

---

<div class="post-metadata">

**Author:** ![interr0bangr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/interr0bangr/32/8089_2.png) [@interr0bangr](https://community.fibery.io/u/interr0bangr)\
**Post date:** [January 4, 2024, 3:42pm UTC](https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622/3 "2024-01-04T15:42:50Z")

</div>

I figured it out using a formula!

It involves creating a checkbox on the Point Log itself that basically had the logic I wish I could put in the automation, but it’s a fine workaround for now.

**“Delete” Formula Field on Point Log:**

```auto
If(
  MatchRegex(Task.Assignees.Join(Name, ", "), User.Name),
  false,
  true
)

```

**The Automation:**

 ![delete_PL](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/9/9008fb3abf3ba11bde89d8478a6044e3a266eeb5.jpeg)

---

<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:** [January 4, 2024, 3:49pm UTC](https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622/4 "2024-01-04T15:49:37Z")

</div>

You need to be cautious when combining database formula fields and automations to achieve a specific goal because they are two independent services, and the relative timing of changes cannot be guaranteed.  
For example, the linked Assignees change to trigger the automation. The filter in the automation’s delete action checks the value of the formula field.  
In parallel, the Assignee change causes the formula field to be updated, but it is not guaranteed that this update will have completed before the filter check occurs. If the formula service is busy updating other entities, it is possible that the automation will not perform as intended.

---

<div class="post-metadata">

**Author:** ![interr0bangr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/interr0bangr/32/8089_2.png) [@interr0bangr](https://community.fibery.io/u/interr0bangr)\
**Post date:** [January 4, 2024, 4:03pm UTC](https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622/5 "2024-01-04T16:03:46Z")

</div>

Good point @Chr1sG, is there another approach you would recommend I take here?

I’m not really a developer so using scripts is a little out of my league.

---

<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:** [January 4, 2024, 4:55pm UTC](https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622/6 "2024-01-04T16:55:55Z")

</div>

> [@interr0bangr](#):
>
> is there another approach you would recommend I take here?

Possibly. But let me check some things first.  
You wrote…

> [@interr0bangr](#):
>
> I want to delete this point log if the user it’s linked to is the same user who was just unliked from the task.
> 
> Relationships:  
> Point Log (M to 1) User  
> Point Log (M to 1) Task  
> Task (M to M) Assignee

Is this correctly understood as: if an Assignee is unlinked from a Task, then delete all of the Point Logs belonging to the Task that also belong to the user who is the unlinked Assignee  
?

---

<div class="post-metadata">

**Author:** ![interr0bangr](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/interr0bangr/32/8089_2.png) [@interr0bangr](https://community.fibery.io/u/interr0bangr)\
**Post date:** [January 4, 2024, 5:56pm UTC](https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622/7 "2024-01-04T17:56:18Z")

</div>

> [@Chr1sG](#):
>
> Is this correctly understood as: if an Assignee is unlinked from a Task, then delete all of the Point Logs belonging to the Task that also belong to the user who is the unlinked Assignee?

Yep, you nailed it!

---

<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:** [January 5, 2024, 2:40pm UTC](https://community.fibery.io/t/using-an-automations-step-1-data-without-a-formula/5622/8 "2024-01-05T14:40:44Z")

</div>

In that case I would suggest the following:

- add a formula field to the Point Log db as follows:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/6/6db85563107a6a9403e8219dc7723178b560c764.png)

- define an automation in the Point Log db that runs when this field becomes true and deletes the Point Log:  

In case it’s not clear what is going on, here’s the explanation:  
the formula takes all the assignees for the Task and selects only the one which matches the User for the Point Log. It will return true if there isn’t a match - this will be true if the list of assignees no longer contains the User for this Point Log. In such an event the automation will cause the Point Log to delete itself.

Strictly speaking, it is not an exact match for what you asked for, since you wanted a trigger when the unlinking occurs, but the solution above will cause the Point Log to be deleted if there is any time in its lifecycle when the User is not amongst the list of Assignees (e.g. if a Point Log is created for a Task and the User is not an Assignee at that time) but I hope this distinction is not important.
