We're updating help docs to reflect our new product naming. Gladly Sidekick (AI) is now called just Gladly, and Gladly Hero (the Platform) is now Gladly Team. Some articles may display outdated names while we update everything. Thank you for your patience! Learn more

App Action Inputs, Variables, and JSONPath

Prev Next

When building an App Action, inputs and variables define what data goes in and what comes out. Inputs are the values the AI collects before the App Action runs. Variables are the values extracted from the final result and made available to the AI for use in a conversation response. Both are referenced and extracted using JSONPath syntax.

Inputs

Inputs are the values your App Action needs in order to run. Not all App Actions require inputs — some rely entirely on built-in Gladly customer context instead.

Adding Inputs

To add an input:

  1. In the Inputs section of the builder, click + Add.

  2. Fill in the following fields:

Field

Description

Name

The input name, written in camelCase (e.g., orderId, customerEmail)

Type

The data type of the input value (see Input Types below)

Description

What this input represents

Input required

Check this box if the input must be provided for the App Action to run

Input Types

Type

Description

Example

string

Text value

"ORDER-123"

number

Numeric value

42

boolean

True/false value

true

object

Nested data structure

{"name": "value"}

array

List of values

[1, 2, 3]

string[]

Array of strings

["a", "b", "c"]

Using Inputs in Steps

Once defined, inputs are referenced in your steps using JSONPath syntax:

Syntax

Description

$.params.orderId

Access a simple input value

$.params.customer.email

Access a nested input value

$.params.items[0].name

Access a specific item in an array input

Inputs Naming Best Practices

  • Use camelCase: orderId, customerEmail

  • Match external API field names where possible

  • Be explicit: use customerEmail rather than just email

Variables

Variables define the outputs of your App Action — specific values extracted from the final step's results that the AI can use when responding to a customer. For example, after filtering an order, you might define variables for orderStatus, trackingNumber, and estimatedDelivery.

Adding Variables

To add a variable:

  1. In the Variables section of the builder, click + Add.

  2. Fill in the following fields:

Field

Description

Name

The variable name, written in camelCase (e.g., orderStatus, trackingNumber)

Description

What this variable represents and its purpose

JSONPath

The path to the value within the final step's output

Type

The data type of the value being extracted (see Variable Types below)

Variable Types

Type

Use For

string

Text values, IDs, statuses

number

Counts, amounts

boolean

Flags, yes/no values

date

Date values

time

Time values

array_of_string

Lists of text items

array_of_number

Lists of numbers

JSONPath Queries

Variables use JSONPath to extract specific values from the final step's output. Here are common query patterns:

Query

Description

$.result.orderId

Simple property

$.result.customer.email

Nested property

$.result.items[0].name

First item in an array

$.result.items[*].name

All items in an array

$.result.orders[-1]

Last item in an array

$.result.items[?(@.status == 'active')]

Filter items by condition

How Variables Are Used

When your App Action runs in an AI guide, the extracted variable values become available for the AI to use in its response. For example:

Customer: "What's the status of my order?"

[App Action runs with orderId parameter]

Variables extracted:
- orderStatus: "Shipped"
- trackingNumber: "1Z999AA10123456784"
- estimatedDelivery: "March 20, 2026"

AI responds:
"Your order has shipped! The tracking number is
1Z999AA10123456784, and it should arrive by March 20, 2026."

Variables Naming Best Practices

  • Use camelCase: orderStatus, totalAmount

  • Name variables to match what they represent: itemCount rather than just count

  • Be specific: estimatedDeliveryDate rather than just date

Contact Support

Can’t find the answer you need? Get in touch with the Gladly Support Team for assistance.

Contact Us