# How can I change a component property inside of a component?

**URL:** <https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024>\
**Category:** Ask us anything\
**Created:** [April 9, 2024, 3:39pm UTC](https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024 "2024-04-09T15:39:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![andystrb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/andystrb/32/4974_2.png) [@andystrb](https://community.weweb.io/u/andystrb)\
**Post date:** [April 9, 2024, 3:39pm UTC](https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024/1 "2024-04-09T15:39:24Z")

</div>

Hi there,

I am currently building a task component. It includes a property called “Done” that allows you to mark a task as complete or incomplete. This property is linked to various style properties within the component. Everything works correctly when I modify the “Done” property externally. However, I am facing an issue when attempting to alter the “Done” property internally within the component. It seems that I do not have access to the property in the workflow builder or I’m just unable to find it. 🤷‍♂️

What can I do to modify the component property within the component itself?

Thanks in advance,  
Andy

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [April 9, 2024, 3:46pm UTC](https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024/2 "2024-04-09T15:46:31Z")

</div>

The property is managed exclusively by the instances, so you cannot really. What you can do is:

- Create a variable
- You can manipulate and bind to this variable
- Make a workflow ‘On prop change’ and then update the variable when the property changes

---

<div class="post-metadata">

**Author:** ![andystrb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/andystrb/32/4974_2.png) [@andystrb](https://community.weweb.io/u/andystrb)\
**Post date:** [April 9, 2024, 3:52pm UTC](https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024/3 "2024-04-09T15:52:48Z")

</div>

Hi @luka, thank you so much for your fast response. Maybe I missunderstand something, but I don’t want to wait for the “On prop change” event, I want to trigger that event inside the instance!?!

---

<div class="post-metadata">

**Author:** ![Profound5753](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/profound5753/32/6870_2.png) [@Profound5753](https://community.weweb.io/u/Profound5753)\
**Post date:** [April 9, 2024, 6:19pm UTC](https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024/4 "2024-04-09T18:19:49Z")

</div>

Trigger event = done. Do this inside the component and provide whatever event schema

Then …

Head to the instance and go to workflows then select your “done” trigger and continue your workflow from there.

But if this isn’t it then follow Luka’s advice. I do components all the time.

---

<div class="post-metadata">

**Author:** ![andystrb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/andystrb/32/4974_2.png) [@andystrb](https://community.weweb.io/u/andystrb)\
**Post date:** [April 10, 2024, 7:09am UTC](https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024/5 "2024-04-10T07:09:59Z")

</div>

Hm… thank you so much for your help guys… After some try and error I’ve done it this way:

- I’ve created a boolean component variable for the checked/unchecked state
- I’ve created a new state with a condition using this variable
- I’ve created a workflow where I change this variable on click to true or false
- I’ve created a boolean property and when I set it to true or false this will update the variable with the “On property change” event.

Now I can change the state of the component from outsite (by using the property) and from inside (by clicking on an element). BUUUUUT 🤪 How can I also update the property, when I’m clicking on an element and change the variable. In other words: When I change the check status by changing the component variable I want also change the component property automatically so that this keeps consistent.

I’ve searched for Trigger event and event schema, but I couldn’t find anything how to use it 🤷‍♂️

Thanks in Advance,  
Andy

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [May 27, 2024, 1:58am UTC](https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024/6 "2024-05-27T01:58:59Z")

</div>

I’m having a similar challenge with keeping text up to date after it’s been edited.

My use case:

- component with a property named Title
- Title is shown as read-only text by default
- User can click an Edit button, and then the UI displays a textfield for the Title field
- User can edit the Title
- User clicks Save, textfield changes back to readonly text, but the read-only text is still the old text from the property

I need to be able to update the property because the read-only text is bound to it!

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [June 8, 2024, 2:55am UTC](https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024/7 "2024-06-08T02:55:19Z")

</div>

Any luck? I’m still scratching my head on this one.

---

<div class="post-metadata">

**Author:** ![luka](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/luka/32/1571_2.png) [@luka](https://community.weweb.io/u/luka)\
**Post date:** [June 10, 2024, 11:46am UTC](https://community.weweb.io/t/how-can-i-change-a-component-property-inside-of-a-component/8024/8 "2024-06-10T11:46:20Z")

</div>

Same applies as my first comment here, use a component variable to manipulate and change text and only use the prop for the initial value
