# Binding a value in a component

**URL:** https://community.weweb.io/t/binding-a-value-in-a-component/7262
**Category:** How do I?
**Created:** [February 26, 2024, 1:16pm UTC](https://community.weweb.io/t/binding-a-value-in-a-component/7262 "2024-02-26T13:16:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![plyford](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@plyford](https://community.weweb.io/u/plyford)
#### Post date: [February 26, 2024, 1:16pm UTC](https://community.weweb.io/t/binding-a-value-in-a-component/7262/1 "2024-02-26T13:16:05Z")

</div>

Ive tried to use a variable within a component. When trying to bind to an API (on a submit button workflow) i get undefined values. When i try to workflow the component variable to update a data parameter, i also get blank values.

Is there a way around this to be able to use the values in the API - within components…

Thanks

---

<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: [February 26, 2024, 1:23pm UTC](https://community.weweb.io/t/binding-a-value-in-a-component/7262/2 "2024-02-26T13:23:17Z")

</div>

Can you post a few screenshots for more context?

---

<div class="post-metadata">

### Author: ![plyford](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@plyford](https://community.weweb.io/u/plyford)
#### Post date: [February 26, 2024, 2:00pm UTC](https://community.weweb.io/t/binding-a-value-in-a-component/7262/3 "2024-02-26T14:00:51Z")

</div>

This is the input field within the component

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/4f6e2d18e6962e081c6c40400beb60689e61a27b.png)

Ive tried using variables within component too (set to share outside)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/a/af438aee06ea4686eccffcced0c31b3c221fb8d4.png)

values blank in binding to API

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/88cfbd39544b8a2ee791a03b8e5ceeff2e829a8e.png)

---

<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: [February 26, 2024, 2:14pm UTC](https://community.weweb.io/t/binding-a-value-in-a-component/7262/4 "2024-02-26T14:14:41Z")

</div>

Are you updating the variable on change?

---

<div class="post-metadata">

### Author: ![plyford](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@plyford](https://community.weweb.io/u/plyford)
#### Post date: [February 26, 2024, 4:49pm UTC](https://community.weweb.io/t/binding-a-value-in-a-component/7262/5 "2024-02-26T16:49:40Z")

</div>

Hi Luka  
I did try this by updating an external variable first, but this didnt work. Rethinking this after your question, i now have it working by the change updating the internal component variable instead which is externally visible. In short, the gap was i assumed the variable like an input was auto updating.

Thanks for your help
