# Reusable Elements + Workflow (SPA)

**URL:** <https://forum.bubble.io/t/reusable-elements-workflow-spa/343916>\
**Category:** Need help\
**Created:** [October 11, 2024, 2:14am UTC](https://forum.bubble.io/t/reusable-elements-workflow-spa/343916 "2024-10-11T02:14:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerdes](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gerdes/32/232414_2.png) [@gerdes](https://forum.bubble.io/u/gerdes)\
**Post date:** [October 11, 2024, 2:14am UTC](https://forum.bubble.io/t/reusable-elements-workflow-spa/343916/1 "2024-10-11T02:14:40Z")

</div>

I am currently building a single page app, and I have a group that has many workflows, buttons, etc. tied to it. This group will be used in many areas throughout the app and I want to turn it into a reusable element.

However, when converted into a reusable element I have over 100 errors because the workflows are disconnected with the page.

Is there a fix for this? Or must I just build without reusing elements in an SPA?

---

<div class="post-metadata">

**Author:** ![BimaAdhtiyaS\_12](https://avatars.discourse-cdn.com/v4/letter/b/65b543/32.png) [@BimaAdhtiyaS\_12](https://forum.bubble.io/u/BimaAdhtiyaS_12)\
**Post date:** [October 11, 2024, 2:31am UTC](https://forum.bubble.io/t/reusable-elements-workflow-spa/343916/2 "2024-10-11T02:31:45Z")

</div>

What kind of errors?

I would prefer make it as reuseable element to reduce tons of workflow on the page I working on

---

<div class="post-metadata">

**Author:** ![gerdes](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gerdes/32/232414_2.png) [@gerdes](https://forum.bubble.io/u/gerdes)\
**Post date:** [October 11, 2024, 2:46am UTC](https://forum.bubble.io/t/reusable-elements-workflow-spa/343916/3 "2024-10-11T02:46:17Z")

</div>

Elements not found/states not found errors

---

<div class="post-metadata">

**Author:** ![BimaAdhtiyaS\_12](https://avatars.discourse-cdn.com/v4/letter/b/65b543/32.png) [@BimaAdhtiyaS\_12](https://forum.bubble.io/u/BimaAdhtiyaS_12)\
**Post date:** [October 11, 2024, 2:58am UTC](https://forum.bubble.io/t/reusable-elements-workflow-spa/343916/4 "2024-10-11T02:58:30Z")

</div>

Either that means you use some of the element outside of your group as reference or you also have custom state outside of the group.

Is kinda hard for me to imagine it, If you don’t mind can i take a look at your editor for better picture what the problem is?

---

<div class="post-metadata">

**Author:** ![ihsanzainal84](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ihsanzainal84/32/245932_2.png) [@ihsanzainal84](https://forum.bubble.io/u/ihsanzainal84)\
**Post date:** [October 11, 2024, 5:29am UTC](https://forum.bubble.io/t/reusable-elements-workflow-spa/343916/5 "2024-10-11T05:29:02Z")

</div>

Reusable elements can refer to states within itself, it’s own data source nd “Properties” you define for the RE.

Read more here: [Reusable Elements | Bubble Docs](https://manual.bubble.io/core-resources/elements/reusable-elements)

The reason for the errors is that after conversion, elements in the new RE is trying to refer to elements that existed outside of itself. Create new states, properties or RE data source and point the errors to the appropriate ones.

---

<div class="post-metadata">

**Author:** ![bkerryk](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/bkerryk/32/184126_2.png) [@bkerryk](https://forum.bubble.io/u/bkerryk)\
**Post date:** [October 14, 2024, 9:52pm UTC](https://forum.bubble.io/t/reusable-elements-workflow-spa/343916/6 "2024-10-14T21:52:43Z")

</div>

With some assumptions you probably have the states on the page element. This makes converting the states into the RE not automatic with copying. BUT, if the states are on a non-page element then recreate the reusable element with the element that has the states. If you can do t his then some of the expressions wont break.

Now lets say you can’t do what I said above and you have a 100 errors to fix.

You need to remake the states and replace the broken expressions with these new states. This is annoying but possible.

Now if this is what you need to do, I’d suggest you put states into their own element or organisation and easy copying. I do this by making a floating group that is 0px by 0px and VISIBLE. Then I put in a element for the states and name it something that has “states” in the name, like “Flow steps states”. This makes for easy searching and also you can _group_ the states based on their purpose for better organisation.

As for the Data type that some expressions are are now missing from the page. Click on the reusable elements page element and then navigate to the properties section that @ihsanzainal84 referred to above and add the data type needed to fix all the broken expressions. So for example if its a thing like ‘User’, add user as a property and then reference that property when fixing the expressions.

Copy and cloning in Bubble is super powerful but it can become a nightmare when states and data types can follow in the copy. Best of luck.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [December 20, 2024, 2:15am UTC](https://forum.bubble.io/t/reusable-elements-workflow-spa/343916/7 "2024-12-20T02:15:35Z")

</div>

Closed on December 20, 2024, 2:15am UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
