# Failed rule "s.match is not a function"

**URL:** <https://community.fibery.io/t/failed-rule-s-match-is-not-a-function/5861>\
**Category:** API & Programming\
**Created:** [February 17, 2024, 10:40am UTC](https://community.fibery.io/t/failed-rule-s-match-is-not-a-function/5861 "2024-02-17T10:40:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giuse](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/giuse/32/8487_2.png) [@Giuse](https://community.fibery.io/u/Giuse)\
**Post date:** [February 17, 2024, 10:40am UTC](https://community.fibery.io/t/failed-rule-s-match-is-not-a-function/5861/1 "2024-02-17T10:40:22Z")

</div>

Hi, I am trying to set the value of a select field to the option “Internal” with

```auto
await fibery.updateEntity(entity.type, entity.id, {
        'Last Update' : { 'Id': '...id...', 'Name': 'Internal' }
    });

```

and I am getting the error

```auto
Failed to execute Action "Script": s.match is not a function

```

setting the Name fields just works… what can it be?  
thank you very much

Giuse

---

<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:** [February 17, 2024, 11:10am UTC](https://community.fibery.io/t/failed-rule-s-match-is-not-a-function/5861/2 "2024-02-17T11:10:20Z")

</div>

To be clear, you’re trying to update the value of a single-select field (called ‘Last update’) to be ‘Internal’, which is an existing option for that field, is that right?

If so, then you just need to do this:

```auto
    await fibery.updateEntity(entity.type, entity.id, {
        'Last update': 'Internal'
    });

```

---

<div class="post-metadata">

**Author:** ![Sev](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Sev](https://community.fibery.io/u/Sev)\
**Post date:** [March 27, 2026, 3:14pm UTC](https://community.fibery.io/t/failed-rule-s-match-is-not-a-function/5861/3 "2026-03-27T15:14:22Z")

</div>

HI @Chr1sG. Thanks, but is there a way to not have to hard-code the label of the option into the script action, so that the script does not break as option names are improved, corrected, normalised or changed for whatever reason. I have tried various ways to use the UUID of the option, but I cannot figure out the correct object notation, even though I have tried pretty much all combinations with the UUID and even Public ID.

Is the workaround to use `addCollectionItem` with the enum DB’s `entities` field somehow?

---

<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:** [March 27, 2026, 3:41pm UTC](https://community.fibery.io/t/failed-rule-s-match-is-not-a-function/5861/4 "2026-03-27T15:41:52Z")

</div>

```auto
await fibery.updateEntity(entity.type, entity.id, {
    'Last update': '136194f0-29f3-11f1-8681-0f3eec7ed495'
});

```

where `136194f0-29f3-11f1-8681-0f3eec7ed495` is the UUID of the option should work fine (for updating a single-select field called ‘Last update’).

Are you trying to update a multi-select?

---

<div class="post-metadata">

**Author:** ![Sev](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Sev](https://community.fibery.io/u/Sev)\
**Post date:** [March 27, 2026, 4:03pm UTC](https://community.fibery.io/t/failed-rule-s-match-is-not-a-function/5861/5 "2026-03-27T16:03:59Z")

</div>

Thank you so much! Yes, also multi-select. But this single select one helps a lot, as I kept trying to pass it as an object, not realising that the whole s.match is probably because you are checking to see if the string is a UUID or not.

---

<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:** [March 27, 2026, 4:15pm UTC](https://community.fibery.io/t/failed-rule-s-match-is-not-a-function/5861/6 "2026-03-27T16:15:46Z")

</div>

> [@Sev](#):
>
> Yes, also multi-select

multi-selects are treated like to-many relations (collection fields) so should use the addCollectionItem syntax

---

<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:** [March 27, 2026, 4:15pm UTC](https://community.fibery.io/t/failed-rule-s-match-is-not-a-function/5861/7 "2026-03-27T16:15:51Z")

</div>


