# Update Variable Based on Another Variable Having Data

**URL:** <https://community.weweb.io/t/update-variable-based-on-another-variable-having-data/7281>\
**Category:** How do I?\
**Tags:** xano\
**Created:** [February 27, 2024, 5:27am UTC](https://community.weweb.io/t/update-variable-based-on-another-variable-having-data/7281 "2024-02-27T05:27:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbushell](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@sbushell](https://community.weweb.io/u/sbushell)\
**Post date:** [February 27, 2024, 5:27am UTC](https://community.weweb.io/t/update-variable-based-on-another-variable-having-data/7281/1 "2024-02-27T05:27:58Z")

</div>

I have a search field that links to my database and shows entries.

When a user clicks the entry it updates the variable selectedSchool

I want to show a div below, but only if the selectedSchool has data.

Hey,

I might be going about this completely the wrong way, but this is what I’m trying to do.

I tried doing it by setting the conditional rendering to selectedSchool, but the value seems to be {}, so the div still appears.

I created a boolean variable called isSchoolSelected and can get this div to show/hide when I manually update the variable value.

How can I get that when the user selects a school, isSchoolSelected changes to true and the div shows?
