> 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/variable-source.md).

# Variable source

This example demonstrates how to set up dependencies between controls in a user step to affect the data output shown to the End-user.

The example is based on the source being a variable.

{% 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. Create a User step and bind it to the start step with a sequence arrow.
3. Create a Script step and add a data arrow to the user step.&#x20;
4. Add the following script to the script step and set its target variable to *categories*.

```
let pens = [{name: "Red pen"}, {name: "Green pen"}, {name: "Blue pen"}];
let papers = [{name: "Paper (single)"}, {name: "Paper (multiple)"}];
let boxes = [{name : "Small box"}, {name: "Big box"}];

let paperAndPen = {name: "Paper and Pen", value: pens & papers};
let penCategory = {name: "Pens", value: pens};
let storage = {name: "Storage", value: boxes};

return [paperAndPen, penCategory, storage];
```

## Create and connect list controls

1. Check the Allow Dependencies checkbox in the user step general section.
2. Create a List selection control in the user step.
   1. Set Source to be *categories.*
   2. Set the Prompt to be *Category.*
   3. Set the Large Row Text to be *{name}.*
   4. Set the Target Variable to be *category.*
3. Create another List selection in the user step.
   1. Set Source to be *category.value.*
   2. Set the Prompt to be *Item.*
   3. Set the Large Row Text to be *{name}.*
   4. Set the Selection reload behaviour to be *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 category list selection and select *Paper and pen.*
4. Open the item list selection.
   1. You can now see that you options are limited to only the pens and papers.
      1. Red pen
      2. Blue pen
      3. Green pen
      4. Paper (single)
      5. Paper (multiple)
   2. Select the Red pen
5. Open the category list selection and select *Pens.*
6. Open the item list selection.
   1. You can now see that the Red pen is still selected since it is still a valid option to select and the control has been set to *Keep my local changes.*
   2. You can see that your options are limited to only pens.
      1. Red pen
      2. Green pen
      3. Blue pen
7. Open the category list selection and select *Storage.*
8. Open the item list selection.
   1. You can now see that the Red pen is no longer selected since it is no longer a valid option.
   2. You can see that your options are limited to only boxes.
      1. Big box
      2. Small box

## Test the user step with discard my local changes

1. Open the Application in the Designer.
2. Open the User step with the List controls.
3. Open the item list selection.
4. Set the Selection reload behaviour to be *discard my local changes.*
5. Repeat step 1 - 5 in from the previous example of **Test Reload Strategy Keep Changes.**
6. Open the item list selection
   1. You can now see that the Red pen is not selected anymore after the change of the category due the control being set to *Discard my local changes*.
   2. You can see that your options are limited to only pens.
      1. Red pen
      2. Green pen
      3. Blue pen


---

# 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/variable-source.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.
