# Variables for BOTH sides of IF

**URL:** <https://community.glideapps.com/t/variables-for-both-sides-of-if/3957>\
**Category:** Feature Requests\
**Created:** [January 25, 2020, 7:23am UTC](https://community.glideapps.com/t/variables-for-both-sides-of-if/3957 "2020-01-25T07:23:14Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [January 25, 2020, 8:32pm UTC](https://community.glideapps.com/t/variables-for-both-sides-of-if/3957/4 "2020-01-25T20:32:37Z")

</div>

I have a use case that I ran into today. I was trying to set up 2 choice components…one that affects the other. For example I have a list of dates. In the first choice component you can select a date. The second choice component is sourced from a sheet that contains dates and a list of times repeated for each date. This is for a reservation type of system. What I was hoping to accomplish, was to take the selected value from the first choice component and use it in a filter on the second component, so only the times show in the second choice component where the date matches the date in the first choice component. Filters, Visibility, and If-Then-Else only let you compare to static values instead of comparing two columns in a sheet.

I ultimately changed the flow to have the first choice component build an inline list using a relation. I also just now built a choice component off of that same relation, so that seems to work, but the reserve button is suppose to hide when the second choice component is empty. Doesn’t seem to update the visibility when returning from a form submission. Also, I don’t think I could use a relation to control a second choice component when I’m in Add/Edit mode, so I had to do this in View mode, whereas I think being able to select a column value from the screen and comparing it to the choice list would help here instead of only being able to compare the choice list to a static value inside the filter.

You can check it out here:

> [@Delay in data refreshing](https://community.glideapps.com/t/delay-in-data-refreshing/3792/8):
>
> I may have been wrong. That’s what happens when I quickly write these responses from my phone and I’m not by a computer to verify what I’m saying. wink My only suggestion to speed things up involves keeping a full list of date time combinations, then using relations to build a list of available times. When selecting a time, it takes you to a detail page where the user can then reserve that time slot. I put together an example in the WeVet app ([https://lhxgi.glideapp.io](https://lhxgi.glideapp.io)) that I had a copy …

---

_[View the full topic](https://community.glideapps.com/t/variables-for-both-sides-of-if/3957)._
