# Enable fields based on other fields

**URL:** https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549
**Category:** Ask for Help
**Created:** [October 31, 2019, 12:02am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549 "2019-10-31T00:02:43Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)
#### Post date: [October 31, 2019, 12:02am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/1 "2019-10-31T00:02:43Z")

</div>

Hello Gliders,  
I am wondering if there is a way to enable fields based on inputs to other fields. So for e.g. show field _ **Color** _ only if the entry in the _ **Product** _ field is Tshirt.  
Thanks much!

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [October 31, 2019, 2:56am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/2 "2019-10-31T02:56:04Z")

</div>

Are you talking about adding/editing records, or just viewing them? I don’t think you can control fields showing or hiding when adding/editing, but when viewing a record, column values that are empty will not display.

---

<div class="post-metadata">

### Author: ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)
#### Post date: [November 16, 2019, 8:22pm UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/3 "2019-11-16T20:22:10Z")

</div>

I was hoping to use such a feature for adding/editing records. Certain columns only apply to certain product types and it makes the layout really clunky to have all columns display for all products irrespective of whether they apply or not. Having a feature to enable/disable columns would be great.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [November 20, 2019, 2:17am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/4 "2019-11-20T02:17:28Z")

</div>

This feature is now available in case you weren’t aware.

> [@Conditional visibility of components usage question](https://community.glideapps.com/t/conditional-visibility-of-components-usage-question/1993):
>
> Bravo on this feature release @Mark . Saw the announcement in app but haven’t seen in mentioned in the forums yet. Quick question about implementation, is there a way this can be used which bases it on a condition of the signed in user? Basically i’m trying to accomplish user roles where if the user has a role assigned of “x” they would be able to see the component.

---

<div class="post-metadata">

### Author: ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)
#### Post date: [November 20, 2019, 5:53am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/5 "2019-11-20T05:53:13Z")

</div>

awesome! thankyou!

---

<div class="post-metadata">

### Author: ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)
#### Post date: [November 20, 2019, 11:09pm UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/6 "2019-11-20T23:09:31Z")

</div>

I am not sure how to use this. I only want the user to see items where the date (which is a column) is equal to today(). I can’t do this with the math column. I can’t do this in the google spreadsheet either since the formula would have to be copied into the new item row manually for every new item added.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [November 20, 2019, 11:41pm UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/7 "2019-11-20T23:41:20Z")

</div>

What are you trying to control, a list or other components? You can control a list using a filter with the Within operator.

For your spreadsheet formula, you can auto populate rows using an arrayformula.

[https://docs.glideapps.com/all/guides/quick-starts/intermediate-techniques/calculating-columns](https://docs.glideapps.com/all/guides/quick-starts/intermediate-techniques/calculating-columns)

---

<div class="post-metadata">

### Author: ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)
#### Post date: [November 21, 2019, 4:16am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/8 "2019-11-21T04:16:22Z")

</div>

Thankyou Jeff. The arrayformula worked for one of the issues I was having.  
The feature of controlling ‘visibility’ of components for existing items is awesome. But how would it work for adding new items?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [November 21, 2019, 4:25am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/9 "2019-11-21T04:25:15Z")

</div>

Same way it works with existing items. Just add a condition to the component.

> [@Conditional visibility of components usage question](https://community.glideapps.com/t/conditional-visibility-of-components-usage-question/1993/9):
>
> @mark Seems to be working in Add/Edit mode @yinon_raviv You can now add conditions to show or hide components based on other component or column values. Here are some screen shots that show how to do it. Select a component to edit it’s details: Select the Features tab: Add the condition you want: [Capture3]

---

<div class="post-metadata">

### Author: ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)
#### Post date: [November 21, 2019, 4:41am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/10 "2019-11-21T04:41:16Z")

</div>

I’m certainly am missing something. Let me explain. I have the following 5 components in my sheet

1. Location
2. 
# of employees

3 # of desks  
4. # of machines  
5. # of widgets

For Location 1, I only want to show the components # of employees and # of desks  
For Location 2, I only want to show # of machines and # of widgets  
For Location 3, it should show all components

How would I accomplish this? Visibility feature is tied to only one component right now.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [November 21, 2019, 4:51am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/11 "2019-11-21T04:51:13Z")

</div>

Can you create 2 of each employee, desk, machine and widget components? Then set conditions accordingly.  
Location 1 will show first employee and first desk components  
Location 2 will show first machine and first widget componets  
Location 3 will show second employee, second desk, second machine and second widget components

---

<div class="post-metadata">

### Author: ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)
#### Post date: [November 21, 2019, 5:21am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/12 "2019-11-21T05:21:16Z")

</div>

I can’t create multiple components because i am working with many locations.

The way I was trying to do it is define which components to show per location in a seperate sheet - Locationdetails. Then when the user wants to adds a location item for a specific date in the sheet 'activity; it would lookup which components to show and which to hide based on the ‘show’ component in columns H-K in the activity sheet. Is there another workaround?

![glideappspic1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/9/997ae1e3bc63af3d188e11d7db35a44702021bac.png)

 ![glideappspic2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/5/55aa7b5649eff25a6464551b17051aa24a0177bf.png)

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [November 21, 2019, 5:55am UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/13 "2019-11-21T05:55:07Z")

</div>

This presents new difficulties. I’m going to go ahead and say it’s not possible to do the yes/no lookups in add/edit mode. Potentially it might be possible in detail view when using entry fields, but the record would already need to be added at that point. I had already attempted something like this with no luck and included a thread link below. Maybe if you could somehow encode 4 unique character combinations into your location name. So your location Choice Component would look like “Location 1 E-W-”. You could set you Visibility condition to use the Contains operator. If the location contains “E-” then show the Employees component and so on. That’s kind of the best idea I have for now.

> [@Visibility based on more that one condition](https://community.glideapps.com/t/visibility-based-on-more-that-one-condition/2032/9):
>
> @Mark Looking at @Gerard_Fernandez question again, I may have misunderstood his question. I didn’t realize he was in an Add/Edit situation, so I don’t think I have a solution for him. As for a Visibility condition based on Relation/Lookup I think I may have set it up wrong. I was using a Multiple relation with a Lookup column against that Relation. I changed the Relation to be a non-Multiple single relation. The Lookup column I created against that relation now shows up under the list of co…

---

<div class="post-metadata">

### Author: ![Food2Soil](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/food2soil/32/659_2.png) [@Food2Soil](https://community.glideapps.com/u/Food2Soil)
#### Post date: [November 21, 2019, 6:23pm UTC](https://community.glideapps.com/t/enable-fields-based-on-other-fields/1549/14 "2019-11-21T18:23:22Z")

</div>

Thankyou for suggesting this workaround. This worked perfectly. i used special characters instead of letters. The choice menu looks a bit strange with special characters at the end of the location name but we’ll live with it for now. Thanks again.
