# Functions

URL: https://developers.cuedesk.com/flows/functions

> Process data in a flow with JavaScript in a Function step.

A **Function** step in allows you to write JavaScript code to process some data in your flow. This can be useful if you want to transform a response from an HTTP request into a certain type of string to include in a message for a user.

A function step requires:

<table>
    <tr>
        <td>Field</td>
        <td>Description</td>
    </tr>
    <tr>
        <td>Input</td>
        <td>This could be a string, JSON or other data collected in a flow.</td>
    </tr>
    <tr>
        <td>Save result as</td>
        <td>The name of the variable you want to assign the result to</td>
    </tr>
    <tr>
        <td>Code</td>
        <td>The code for processing the input.</td>
    </tr>
</table>

## Output [#output]
To reference the output of a function you can use the name of the variable you saved your result to. So if in your function step you saved the result as `data` you can reference this value returned from the function using `{{session.data.output}}`.
