# Pre-fill input field with data after button click

**URL:** <https://forum.bubble.io/t/pre-fill-input-field-with-data-after-button-click/91643>\
**Category:** Database\
**Created:** [May 14, 2020, 3:05am UTC](https://forum.bubble.io/t/pre-fill-input-field-with-data-after-button-click/91643 "2020-05-14T03:05:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ALB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alb/32/54352_2.png) [@ALB](https://forum.bubble.io/u/ALB)\
**Post date:** [May 14, 2020, 3:05am UTC](https://forum.bubble.io/t/pre-fill-input-field-with-data-after-button-click/91643/1 "2020-05-14T03:05:04Z")

</div>

Hi folks, surprised I haven’t been able to figure this out or find out how to do it.

Specifically, I have **Input Company Name** and **RichTextInput Company Details**. I also have **Button Load** and **Button Save**.

I’d like to be able to type a company into **Input Company Name** , hit **Button Load** , and have **RichTextInput Company Details** get filled with a database entry.

**Button Save** is the easy part, no problems there.

I know I can pre-populate an input on page load with _Initial Content_, but I can’t for the life of me figure out how to populate an Input field within a workflow / action (i.e. after a button click).

Am I missing something obvious?

Thanks!  
Al

---

<div class="post-metadata">

**Author:** ![david17](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/david17/32/59859_2.png) [@david17](https://forum.bubble.io/u/david17)\
**Post date:** [May 14, 2020, 5:51am UTC](https://forum.bubble.io/t/pre-fill-input-field-with-data-after-button-click/91643/2 "2020-05-14T05:51:52Z")

</div>

If you set the Initial Content to read from the item’s custom state, and then set the state on the button click, that should do it.

---

<div class="post-metadata">

**Author:** ![ALB](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/alb/32/54352_2.png) [@ALB](https://forum.bubble.io/u/ALB)\
**Post date:** [May 19, 2020, 2:39am UTC](https://forum.bubble.io/t/pre-fill-input-field-with-data-after-button-click/91643/3 "2020-05-19T02:39:53Z")

</div>

Hey @david17, thanks for the reply. I’m not having luck finding out how to “read from the item’s custom state”. Can you point me at something that helps me understand this concept?

---

<div class="post-metadata">

**Author:** ![david17](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/david17/32/59859_2.png) [@david17](https://forum.bubble.io/u/david17)\
**Post date:** [May 19, 2020, 5:38am UTC](https://forum.bubble.io/t/pre-fill-input-field-with-data-after-button-click/91643/4 "2020-05-19T05:38:44Z")

</div>

If you click the (i) on the element in the top right corner, you can add “custom states”. This state can have a default or be set at any other point in the session.

As long as you have not edited the input (that’s when the initial content is disregarded), the input’s value will be the value of the state.

 ![Screen Shot 2020-05-18 at 10.37.04 PM](https://us1.discourse-cdn.com/bubble/original/3X/c/5/c559d8d6ff4bad2954f46015aab19a96fa815bbd.png)
