--- title: "Using Evaluate JavaScript" slug: "using-enhanced-javascript" updated: 2026-11-09T16:31:51Z published: 2026-11-09T16:31:51Z canonical: "help.userflow.com/using-enhanced-javascript" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://help.userflow.com/llms.txt > Use this file to discover all available pages before exploring further. # Using Evaluate JavaScript Evaluate JavaScript is an action that runs your own JavaScript code in your app. You can add it to a button or a step trigger in a flow, or to a button in a banner, to trigger behaviour or integrations in your app. It's sometimes called "Enhanced JavaScript". ## How do I add an Evaluate JavaScript action? 1. Open the flow or banner and select the button or step trigger. 2. Add an action and choose **Evaluate JavaScript**. ![The action menu on a button with Evaluate JavaScript selected](https://cdn.us.document360.io/9697557a-eb5d-476f-9b09-062b0f7bdcbd/Images/Documentation/image(375).png) 3. Enter the code to run. ![The Evaluate JavaScript code field with an example script](https://cdn.us.document360.io/9697557a-eb5d-476f-9b09-062b0f7bdcbd/Images/Documentation/image(376).png) For the other actions a button or trigger can run, see [Which actions can a trigger or button run? in Flow builder basics](/userflow/docs/flow-builder-basics). > [!NOTE] > User attributes vs. company attributes > > We recommend using user attributes in Evaluate JavaScript. They give consistent results, while company attributes need extra setup. ## How do I use a user attribute in Evaluate JavaScript? Insert a user attribute with double curly braces, and wrap it in quotes so the result is valid JavaScript: - **Text, numbers, lists, or dates:** use single (') or double (") quotes around the braces. `const email = '{{email}}';` `const locale = "{{locale_code}}";` - **Multi-line text** (for example, an attribute bound to a multi-line text survey question): use backticks (`) instead, because a line break inside single or double quotes breaks the code. The backtick key is to the left of the 1 key on a QWERTY keyboard. `const feedback = `{{user_nps_feedback}}`;` - **Passing an attribute to a function in your app:** put the quoted attribute inside the function's parentheses. `openForm('{{user_nps_score}}');` To save survey answers as attributes you can use here, see [Surveys/NPS](/userflow/docs/surveysnps). ## Related articles - [Flow builder basics](/userflow/docs/flow-builder-basics) - [Embed a Banner or Checklist](/userflow/docs/embed-a-banner-or-checklist) - [Surveys/NPS](/userflow/docs/surveysnps)