# Hiding a component until a row is selected

If, for example, you need to hide a component until a row is selected in a table, you need to do the following:

1. Select the component that you want to add conditional visibility to. In this example, that component is a table that displays all the purchases made by the selected customer.
2. In the component menu, go to the *Display* section.
3. Click in the *Conditional Visibility* field, and choose the condition that you want to use, or use a formula. In this example, I'm choosing my *Customers* table and then *Selected Row*. This way, when my user clicks on a customer, a table will appear below the first one that shows all the purchases made by that customer. Note that I click on the *Apply* button next to *Selected Row* – this is because I don't want a specific value from that row.&#x20;

You do not have to enter it manually, but the value of the Conditional Visibility field in this case will be&#x20;

`=elements.Customers["0"].selected_item`

{% hint style="info" %}
The table will now be hidden as long as no row is selected in the table.
{% endhint %}

App Builder view:

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FauBWYJqI8gL8OTPwJUey%2FUntitled7.gif?alt=media&#x26;token=4ef52097-2593-4fb9-95dd-8471b77e48cc" alt=""><figcaption></figcaption></figure>

App view:

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FTubg5a7qtG6nAllKuZJE%2FUntitled8.gif?alt=media&#x26;token=d6d47827-b622-4299-bfce-c5411193a12c" alt=""><figcaption></figcaption></figure>
