# Modify a Left - formula

**URL:** https://community.fibery.io/t/modify-a-left-formula/4335
**Category:** Get Help
**Created:** [April 18, 2023, 10:40am UTC](https://community.fibery.io/t/modify-a-left-formula/4335 "2023-04-18T10:40:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Marloes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/marloes/32/5926_2.png) [@Marloes](https://community.fibery.io/u/Marloes)
#### Post date: [April 18, 2023, 10:40am UTC](https://community.fibery.io/t/modify-a-left-formula/4335/1 "2023-04-18T10:40:00Z")

</div>

Hi

I have two automations.

- One is to link an _Afspraak_ entity to a _Event type_.
- If _Afspraak_ can not be linked, because there’s no _Event type_ matching the criteria a new _Event Type_ need to be created.

This is where automation number 2 gets triggered.

- The name of _Afspraak_ looks something like this: _New event - 10 mei 2023 om 16:00 uur_
- The name of _Event type_ should be _New event_

For that I’m using the following formula:

Left([Step 1 Afspraak].Name,(Length([Step 1 Afspraak].Name) - Find([Step 1 Afspraak].Name,“-”)) - 1)

But instead of _New event_ the result is _New event - 10 mei 202_.

As you can see, the -1 from the formula is applied, but in the wrong place. It should remove the space before -. Is this due to a mistake in my formula setup, due to a bug or something else?

Thanks

---

<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: [April 18, 2023, 4:09pm UTC](https://community.fibery.io/t/modify-a-left-formula/4335/2 "2023-04-18T16:09:41Z")

</div>

Perhaps it would be simpler to use `ReplaceRegex` to trim the " - " substring and everything after it:

```auto
ReplaceRegex( [Step 1 Afspraak].Name, " - .*", "" )

```

---

<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: [April 18, 2023, 5:02pm UTC](https://community.fibery.io/t/modify-a-left-formula/4335/3 "2023-04-18T17:02:04Z")

</div>

I think you need this:

> [@Marloes](#):
>
> Left([Step 1 Afspraak].Name,Find([Step 1 Afspraak].Name,“-”) - 2)

You were trimming to return only the number of characters equal to the length minus the position of the hyphen, minus 1.  
You just need to trim to return the number of characters equal to the position of the hyphen minus 2.  
(assuming the hyphen is always preceded with a space)

---

<div class="post-metadata">

### Author: ![Marloes](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/marloes/32/5926_2.png) [@Marloes](https://community.fibery.io/u/Marloes)
#### Post date: [April 18, 2023, 6:18pm UTC](https://community.fibery.io/t/modify-a-left-formula/4335/4 "2023-04-18T18:18:47Z")

</div>

@Matt_Blais Yes, this does exactly what I was looking for! Didn’t know this function yet. Wondering how long it will happen untill I’m aware of all possibilities within Fibery. 🤓
