--- title: "How to use the value of a JavaScript step or Playwright code step in subsequent steps" slug: "use-js-playwright-values" updated: 2026-04-07T06:11:43Z published: 2026-04-07T06:11:43Z canonical: "helpcenter.autify.com/use-js-playwright-values" --- > ## Documentation Index > Fetch the complete documentation index at: https://helpcenter.autify.com/llms.txt > Use this file to discover all available pages before exploring further. # How to use the value of a JavaScript step or Playwright code step in subsequent steps This article explains the steps to dynamically use values generated or retrieved in a JavaScript step or a Playwright code step in subsequent steps (e.g., **Input text** or **Navigate**). ## Steps ### 1. Create a step that outputs a value First, set up the step that generates and passes the value. 1. In the scenario editor, add a **JavaScript step** or a **Playwright code step**. 2. Write the process in the **Code** field of the step. 3. At the end of the code, return the value you want to pass to the subsequent steps using the `return` statement. Example of a JavaScript step: ```plaintext return "test";   ``` Example of a Playwright code step: ```plaintext const title = await page.title();   return title;   ``` > **Note**: If there is no `return` statement, the value will not be passed to the subsequent steps. 4. Save the step. ### 2. Reference the value in a subsequent step Next, set up the step that receives the output value. 1. Open the edit screen of the step where you want to use the value (e.g., **Input text**). *※This step must be placed after the step that passes the value.* 2. Click the dropdown above the field where you specify the value (default: **Given value**) and select **Other step's output**. ![](https://cdn.document360.io/c040854c-2c75-49d0-98e1-43f462e8657e/Images/Documentation/スクリーンショット 2026-03-10 15.26.57(1).png?sv=2026-02-06&spr=https&st=2026-10-27T15%3A41%3A44Z&se=2026-10-27T16%3A41%3A44Z&sr=c&sp=r&sig=bsDIu6KZF%2FHqAcoPDG2y%2BeBgEZHpHRldprOKDdiL374%3D) 3. From the displayed dropdown list, select the step created in Step 1. ![](https://cdn.document360.io/c040854c-2c75-49d0-98e1-43f462e8657e/Images/Documentation/スクリーンショット 2026-03-10 15.27.38(1).png?sv=2026-02-06&spr=https&st=2026-10-27T15%3A41%3A44Z&se=2026-10-27T16%3A41%3A44Z&sr=c&sp=r&sig=bsDIu6KZF%2FHqAcoPDG2y%2BeBgEZHpHRldprOKDdiL374%3D) 4. Save the step. ## Notes - **Step order**: To reference a value, the source step (such as a JavaScript step) must be placed before the destination step. - **Data type**: The value returned by `return` is passed to the subsequent steps as a String. - **Conversion to Playwright code step**: A step using **Other step's result** cannot be converted to a Playwright code step.