---
title: "Configure an input column with JavaScript"
slug: "configure-an-input-column-with-javascript"
abstract: "How to configure an input column with JavaScript. This is useful when you want to use custom code as input in the decision table."
---
# Configure an input column with JavaScript

This topic describes how to configure an input column to use JavaScript as input in the decision table. This is useful when you want to use custom code as input in the decision table.

To configure an input column with JavaScript:

1. [Create a decision table](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/introduction-to-decisioning-in-sitecore-personalize/managing-decision-tables-in-sitecore-personalize/create-a-decision-table.html "Create a decision table").
2. On the **Decision Table** tab, in the **Input** column, click **Add Input Column**.
3. In the **Add Input Column** dialog, click **Script**.
4. In the **Name Column** field, enter an intuitive name. The name you enter displays as a column header.
5. Click **Add**. The **JavaScript** editor displays.
6. On the **Settings** tab, in the **Output Reference** field, enter an output reference for the input. This enables you to select the output of the decision table as input in another decision. You must apply the following naming conventions:
    - Do not use hyphens or spaces.
    - The first character must either be an ASCII letter (either uppercase or lowercase), a letter that complies with Unicode variable naming conventions, or an underscore (_) character.
    - Do not use a number as your first character.
    - Subsequent characters must be letters, numbers, or underscores (_).
    - Do not use a reserved word. A reserved word is a keyword that is reserved by JavaScript functions or other uses that cannot be used as identifiers such as variable names, function names, and class names.
7. In the **Type** drop-down list, click the format type of the variable that you want to use as input in the decision table. This is the format type of the variable that is returned from the JavaScript and used as an input in the decision table:
    - **String** - a text value.
    - **Boolean** - a binary value that can either be true or false.
    - **Integer** - a number value.
    - **Long** - an integer that is longer than the size of the standard Integer type. This is useful for large numbers.
    - **Date** - represents a date value.
    - **List** - returns an array for use in a single variable.
    - **Map** - returns the entire object for the next decision to use.

    > [!important]
    > If you select **List** or **Map** as the format type, you won’t be able to use the output of that decision table as input into another decision table.

8. To copy and paste data model attributes and paths to use as dynamic data in JavaScript, click the **Data** tab. To see the data model, you must search for a guest by, for example, the guest's email address, or click **Quick Select Customer** or **Quick Select Visitor**. For example, if you want to use segment membership as dynamic data, search for a guest who is a member of the segment.
9. Enter the JavaScript in the **JavaScript** editor and click the **gear** icon to use the following features as required:
    - **Night mode** - click this link to change the background of the **Editor** to black. To toggle back to a white background, click the **Day mode** link.
    - **Upload** - click this link to upload JavaScript as a .txt file from your local drive.
    - **Download** - click this link to download JavaScript as a .txt file from your local drive. You might want to do this if you want to reuse the JavaScript in another **Decision Model**.
    - **Copy all** - click this link to copy all the JavaScript to your clipboard.
10. Click **Save**. You return to the **Decision Table** tab.
11. To continue creating your decision table you can [configure an output column](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/introduction-to-decisioning-in-sitecore-personalize/managing-decision-tables-in-sitecore-personalize/using-output-columns-in-a-decision-table/configure-an-output-column-in-a-decision-table.html "Configure an output column in a decision table").