# Expression source

{% 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 *electronics*.

   ```
   return [
       {name: "Laptops", category: "Electronics"}, 
       {name: "Monitors", category: "Electronics"}, 
       {name: "Printers", category: "Electronics"}
       ];
   ```
5. Add a new Script step and connect it to the User step with a data arrow.&#x20;
6. Add the following script to the newly created Script step and set its target variable to *furniture*.

   ```
   return [
       {name: "Desks", category: "Furniture"}, 
       {name: "Chairs", category: "Furniture"}, 
       {name: "Cabinets", category: "Furniture"}
       ];
   ```
7. Add a new Script step and connect it to the User step with a data arrow.&#x20;
8. Add the following script to the newly created Script step and set its target variable to *apparel*.

   ```
   return [
       {name: "Shirts", category: "Apparel"}, 
       {name: "Pants", category: "Apparel"}, 
       {name: "Jackets", category: "Apparel"}
       ];
   ```

## Create and connect controls

* Check the Allow Dependencies checkbox in the User step General section.
* Create a Text Input control in the user step.
  1. Set the Prompt to *What are you looking for?*
  2. Set the Target Variable to be *product.*
* Create a List Selection in the user ste&#x70;*.*
  1. Set the Prompt to *Choose specific item.*
  2. Set the Source to be an expression and set the expression to be the following

     ```
     {apparel & furniture & electronics where name like ("%" & product & "%") or category like ("%" & product & "%")}
     ```
  3. Set the Large Row Text to be *{name}.*
  4. Set the Inline option to *Open*

## Test the user step with where filtering

1. Save the Application.
2. Start the Application in any client.
3. You can now see that options in the List selection contain all nine items that were provided in the script steps.
4. Type Electronics in the Text input.
   1. As you type you can see that the options in the List selection below are limited to only electronics.
5. Type Jacket in the Text input.
   1. As you type you can see that the options in the List Selection below are limited to only Jackets.

## Test the user step with a case expression

1. Open the Application in the designer.
2. Open the user step and select the list selection
3. Change the source expression to the following

   ```
   {case when "Electronic" like ("%" & product & "%") then electronics when "Furniture" like ("%" & product & "%") then furniture else apparel end }
   ```
4. Save the Application.
5. Start the Application in any client.
6. You can now see that options are limited to only Electronics
7. Type Furniture
   1. As you type you can see that the options in the List selection below are limited to only furniture.


---

# Agent Instructions: 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:

```
GET https://docs.novacura.com/flow-connect/reference/how-to-guides/dependent-controls-in-user-step/expression-source.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
