# Automatic form filling if the user selects the first component

**URL:** https://community.glideapps.com/t/automatic-form-filling-if-the-user-selects-the-first-component/67824
**Category:** Ask for Help
**Created:** [November 15, 2023, 1:42pm UTC](https://community.glideapps.com/t/automatic-form-filling-if-the-user-selects-the-first-component/67824 "2023-11-15T13:42:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![abdalla\_abdi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/abdalla_abdi/32/62868_2.png) [@abdalla\_abdi](https://community.glideapps.com/u/abdalla_abdi)
#### Post date: [November 15, 2023, 1:42pm UTC](https://community.glideapps.com/t/automatic-form-filling-if-the-user-selects-the-first-component/67824/1 "2023-11-15T13:42:09Z")

</div>

Hi  
I have a form that writes to ‘rent collection’ table, and has values ‘unit number’, ‘tenant name’, ‘amount’, 'date ’ and ‘payment type’ .What i want is if the user chooses the ‘unit number’ from a choice component, then the ‘tenant name’ and ‘amount’ are automatically populated.  
How do i do it ?

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [November 15, 2023, 11:43pm UTC](https://community.glideapps.com/t/automatic-form-filling-if-the-user-selects-the-first-component/67824/2 "2023-11-15T23:43:11Z")

</div>

Do you mean you want to show that right in the form? That’s not possible, because you don’t have access to that unit number value to create a relation.

I would suggest creating a custom form that:

- Writes the unit number to a user-specific column.
- Use relations & lookups to retrieve the tenant name and amount values.
- If you want users to edit the name & amount, create a button that write the lookup values to 2 user-specific columns, and add entry components for them on the screen.

> [@How do I create a custom form?](https://community.glideapps.com/t/how-do-i-create-a-custom-form/25014):
>
> I’m just dropping this here so I have something to refer people to when they ask. This is a simple concept app (copyable), that demonstrates the following techniques: Building custom forms for adding and editing list items (as an alternative to the native forms provided by Glide) Preventing duplicate new entries using [User Specific Columns](https://docs.glideapps.com/all/reference/data-editor/user-specific-columns) and [Relations](https://docs.glideapps.com/all/reference/data-editor/computed-columns/relation-column) Enforcing mandatory input items The use of visibility conditions and user specific booleans to control user flow There is nothing particula…

---

<div class="post-metadata">

### Author: ![abdalla\_abdi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/abdalla_abdi/32/62868_2.png) [@abdalla\_abdi](https://community.glideapps.com/u/abdalla_abdi)
#### Post date: [November 16, 2023, 2:53pm UTC](https://community.glideapps.com/t/automatic-form-filling-if-the-user-selects-the-first-component/67824/3 "2023-11-16T14:53:53Z")

</div>

Hi again  
First the app is only for one manager so i don’t see the reason for user specific column.  
Second the reason i want the form to automatically be filled when the unit number is selected is that the number of tenants is too many for a choice component to be used and furthermore if the manager were to write the name as a text entry there might be a mistake so that if a want to later relate the tenants name to the name in the ‘rents collection’ table to see if they paid the rent or not the a mistake in the form will create a whole new tenant and can’t be related to the right one.  
Since i have a relation between the ‘unit number’, ‘tenant name’ and ‘rent amount’ in the ‘‘units’’ table how can i use that to automatically fill the rest of the form once ‘unit number’ is inserted or is there another way to do it ?

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [November 16, 2023, 11:25pm UTC](https://community.glideapps.com/t/automatic-form-filling-if-the-user-selects-the-first-component/67824/4 "2023-11-16T23:25:53Z")

</div>

Then I think you can just submit the unit number using the form to the destination table, then use relations & lookups to bring the tenant name and rent amount over.

---

<div class="post-metadata">

### Author: ![abdalla\_abdi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/abdalla_abdi/32/62868_2.png) [@abdalla\_abdi](https://community.glideapps.com/u/abdalla_abdi)
#### Post date: [November 17, 2023, 10:58am UTC](https://community.glideapps.com/t/automatic-form-filling-if-the-user-selects-the-first-component/67824/5 "2023-11-17T10:58:44Z")

</div>

not what i was after but it will do  
thanks

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [November 17, 2023, 11:25pm UTC](https://community.glideapps.com/t/automatic-form-filling-if-the-user-selects-the-first-component/67824/6 "2023-11-17T23:25:54Z")

</div>

Can you explain what was your desired flow? I think the solution above satisfied your needs.

If possible, please share some screenshots so we can help you more.
