> For the complete documentation index, see [llms.txt](https://docs.novacura.com/flow-connect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.novacura.com/flow-connect/reference/how-to-guides/dependent-controls-in-user-step/control-visibility-condition-to-hide.md).

# Control visibility (condition to hide)

{% hint style="info" %}
Ensure that [Allow Dependencies](/flow-connect/reference/reference/designer/steps/user-step.md#allow-dependencies) is set to true for the user step. The user step must allow dependencies for this functionality to work properly.
{% endhint %}

## Create an App with steps and input data

1. Create a new [Application ](https://docs.novacura.com/flow-connect/working-with-connect/create-and-design/applications/create#create-application)in an [Application package](https://docs.novacura.com/flow-connect/working-with-connect/create-and-design/application-packages) and open it in the Designer.
2. Add a User step in the App.
3. Add a Script step and connect it to the User step with a data arrow.&#x20;
4. Add the following script to the  Script step and set its target variable to *items*.

```
let perishable = [{name: "Ice Cream", category: "perishable"}, {name: "Lettuce", category: "perishable"}];
let nonPerishable = [{name: "Canned Beans", category: "non-perishable"}, {name: "Sugar", category: "non-perishable"}];

return perishable & nonPerishable;
```

## Create and connect controls

* Check the Allow Dependencies checkbox in the User step General section.
* Create a List selection control in the user step.
  1. Set Source to be *items.*
  2. Set the Prompt to be *What type of product are you receiving?.*
  3. Set the Large Row Text to be *{name}.*
  4. Set the Target Variable to be *item.*
* Create a Date input in the user ste&#x70;*.*
  1. Set the Prompt to be *Expiration date.*
  2. Set the Condition To Hide to be *{item.category != "perishable"}*
  3. Set the Merge Behavior to *keep my local changes.*
* Create a Text input in the user ste&#x70;*.*
  1. Set the Prompt to be *Storage Requirements.*
  2. Set the Condition To Hide to be *{item.category = "perishable"}*
  3. Set the Merge Behavior to *keep my local changes.*

## Test the user step with keep my local changes

1. Save the Application.
2. Start the Application in any client.
3. Open the list selection and select *Ice Cream.*
   1. Notice that the date input is now being shown as the chosen option category is perishable.
   2. Notice that the text input is hidden as the chosen option is perishable.
4. Set a date in the date input.
5. Open the list selection and select *Canned beans.*
   1. Notice that the date input is hidden as the chosen option category is not perishable.
6. Open the list selection and select *Lettuce.*
   1. Notice that the date input is now being shown as the chosen option category is perishable.
   2. Notice that the date input contains your previous input as the control has been set to *Keep my local changes*.&#x20;

## Test the user step with discard my local changes

1. Open the Application in the Designer.
2. Open the User step.
3. Set the date input Merge Behaviour to *Discard my local changes.*
4. Save the Application.
5. Start the Application in any client.
6. Open the list selection and select *Ice Cream.*
   1. Notice that the date input is now being shown as the chosen option category is perishable.
7. Set a date in the date input.
8. Open the list selection and select *Canned beans.*
   1. Notice that the date input is hidden as the chosen option category is not perishable.
9. Open the list selection and select *Lettuce.*
   1. Notice that the date input is now being shown as the chosen option category is perishable.
   2. Notice that the date input have discarded your previous input as the control has been set to *discard my local changes*.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.novacura.com/flow-connect/reference/how-to-guides/dependent-controls-in-user-step/control-visibility-condition-to-hide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
