# How to use a formula to send a notification to current workspace admins

**URL:** <https://community.fibery.io/t/how-to-use-a-formula-to-send-a-notification-to-current-workspace-admins/7881>\
**Category:** Get Help\
**Created:** [December 2, 2024, 8:52am UTC](https://community.fibery.io/t/how-to-use-a-formula-to-send-a-notification-to-current-workspace-admins/7881 "2024-12-02T08:52:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Ichter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/michael_ichter/32/9931_2.png) [@Michael\_Ichter](https://community.fibery.io/u/Michael_Ichter)\
**Post date:** [December 2, 2024, 8:52am UTC](https://community.fibery.io/t/how-to-use-a-formula-to-send-a-notification-to-current-workspace-admins/7881/1 "2024-12-02T08:52:50Z")

</div>

I really appreciated the script from [the hide spaces forum discussion](https://community.fibery.io/t/hide-spaces-from-non-admin-users/4004/13), and now I want to create an automatic reminder for admins to run this rule whenever a new user is added to the workspace. I assumed it would be fairly straightforward, with the “TO” section of the rule having the formula:

`Users.Filter([User Role] = "Admin")`

However, Fibery says “Reference to undefined variable User Role”. Am I missing something?

---

<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:** [December 2, 2024, 9:49am UTC](https://community.fibery.io/t/how-to-use-a-formula-to-send-a-notification-to-current-workspace-admins/7881/2 "2024-12-02T09:49:19Z")

</div>

> [@Michael\_Ichter](#):
>
> I assumed it would be fairly straightforward, with the “TO” section of the rule having the formula

What do you mean by ‘the “TO” section’ ?

---

<div class="post-metadata">

**Author:** ![Michael\_Ichter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/michael_ichter/32/9931_2.png) [@Michael\_Ichter](https://community.fibery.io/u/Michael_Ichter)\
**Post date:** [December 2, 2024, 10:01am UTC](https://community.fibery.io/t/how-to-use-a-formula-to-send-a-notification-to-current-workspace-admins/7881/3 "2024-12-02T10:01:21Z")

</div>

Sorry, I meant “To”, so the section within a “Notify Users” rule for the recipient of the notification.

---

<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:** [December 2, 2024, 10:16am UTC](https://community.fibery.io/t/how-to-use-a-formula-to-send-a-notification-to-current-workspace-admins/7881/4 "2024-12-02T10:16:35Z")

</div>

Have you considered just automatically running the re-ordering rule whenever a new user is added (and picking an Admin to copy)?

---

<div class="post-metadata">

**Author:** ![Michael\_Ichter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/michael_ichter/32/9931_2.png) [@Michael\_Ichter](https://community.fibery.io/u/Michael_Ichter)\
**Post date:** [December 2, 2024, 10:36am UTC](https://community.fibery.io/t/how-to-use-a-formula-to-send-a-notification-to-current-workspace-admins/7881/5 "2024-12-02T10:36:03Z")

</div>

I wasn’t feeling very confident in modifying the script, but perhaps you can confirm the appropriate change. Would the only change be to replace “args.currentUser[‘Id’]” with the ID number of the relevant user (e.g. 2)?

I was also wanting to “future proof” this in a way in case the admin changes, though perhaps this doesn’t matter as long as the user stays within the system so that their sidebar ranking (even if not an admin) continues to be copied.

---

<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:** [December 2, 2024, 10:49am UTC](https://community.fibery.io/t/how-to-use-a-formula-to-send-a-notification-to-current-workspace-admins/7881/6 "2024-12-02T10:49:29Z")

</div>

> [@Michael\_Ichter](#):
>
> Would the only change be to replace “args.currentUser[‘Id’]” with the ID number of the relevant user (e.g. 2)?

Almost. You need the UUID of the relevant user (which you can get by pressing Alt when hovering over the public id).  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/2/2c48e72d2a72b28a41786ed9c9ff931b891f2669.png)

> [@Michael\_Ichter](#):
>
> I was also wanting to “future proof” this in a way in case the admin changes, though perhaps this doesn’t matter as long as the user stays within the system so that their sidebar ranking (even if not an admin) continues to be copied.

Indeed, it shouldn’t matter as long as that user exists.

---

<div class="post-metadata">

**Author:** ![Michael\_Ichter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/michael_ichter/32/9931_2.png) [@Michael\_Ichter](https://community.fibery.io/u/Michael_Ichter)\
**Post date:** [December 2, 2024, 11:28am UTC](https://community.fibery.io/t/how-to-use-a-formula-to-send-a-notification-to-current-workspace-admins/7881/7 "2024-12-02T11:28:53Z")

</div>

Ok, hopefully final clarifying question (I’m not THAT familiar with scripting other than BASH). The UUID should go in there with single quotes around it, right? So that it should look like this?

```
const userToCopy = await fibery.getEntityById(entity.type,'ccdc1640-a8d9-11ef-a9c2-95456d5d9e32', ['fibery/menu-rank']);

```
