# Can we have a "code library" for a Workspace?

**URL:** <https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354>\
**Category:** Ideas & Features\
**Created:** [February 8, 2021, 7:20pm UTC](https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354 "2021-02-08T19:20:19Z")\
**Posts on this page:** 8\
**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:** [February 8, 2021, 7:20pm UTC](https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354/1 "2021-02-08T19:20:19Z")

</div>

Somewhere to define globally accessible functions that could be called from Button code, etc.

---

<div class="post-metadata">

**Author:** ![mdubakov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/mdubakov/32/10_2.png) [@mdubakov](https://community.fibery.io/u/mdubakov)\
**Post date:** [February 8, 2021, 7:46pm UTC](https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354/2 "2021-02-08T19:46:10Z")

</div>

In fact, it exists. Here is the link [fibery-community / Action Buttons · GitLab](https://gitlab.com/fibery-community/action-buttons)

---

<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:** [February 8, 2021, 8:39pm UTC](https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354/3 "2021-02-08T20:39:29Z")

</div>

@mdubakov, I meant: can we have a place that is **part of a Workspace** where global functions/objects could be defined, and used by any other code in the same Workspace.

---

<div class="post-metadata">

**Author:** ![mdubakov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/mdubakov/32/10_2.png) [@mdubakov](https://community.fibery.io/u/mdubakov)\
**Post date:** [February 10, 2021, 10:48am UTC](https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354/4 "2021-02-10T10:48:52Z")

</div>

Got it, in fact you can just create a separate App in Fibery for that and a Type like Code Sample and store code in Rich Edit field.

---

<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 10, 2021, 1:19pm UTC](https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354/5 "2021-02-10T13:19:36Z")

</div>

I think Matt is interested in having a library of frequently used functions that can be directly called from action buttons, not just a text snippet that can be copy-pasted.  
At least, it’s something I would 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:** [February 10, 2021, 4:37pm UTC](https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354/6 "2021-02-10T16:37:53Z")

</div>

@mdubakov Yes @Chr1sG - that is what I meant! The point is to avoid copy-paste and have just one copy of your codebase/library that can be referenced globally 😉

---

<div class="post-metadata">

**Author:** ![rothnic](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/rothnic/32/1850_2.png) [@rothnic](https://community.fibery.io/u/rothnic)\
**Post date:** [October 21, 2021, 5:23pm UTC](https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354/7 "2021-10-21T17:23:30Z")

</div>

One issue I ran into related to this is if you have some kind of rule that is triggered off an event, like an entity’s field changing, but you also want to support manually triggering the rule. To handle the manual triggering, you have to setup the exact same logic in the action button configuration, which could become out of sync over time.

This particular issue could be handled by supporting the reference of an action button as a trigger for a rule, or by leveraging some kind of shared logic area.

---

<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:** [October 21, 2021, 5:45pm UTC](https://community.fibery.io/t/can-we-have-a-code-library-for-a-workspace/1354/8 "2021-10-21T17:45:38Z")

</div>

Related: [Click Action Buttons with an Action Button?](https://community.fibery.io/t/click-action-buttons-with-an-action-button/1170)
