Skip to main content

Get Answers Action

The Get Answers action loads a booking by ID and exposes its question answers in the workflow context.

Jerome Bajou avatar
Written by Jerome Bajou
Updated over a week ago

Overview

The Get Answers action loads a booking by ID and exposes its question answers in the workflow context. It returns booking-level, guest-level, and extra-level answers as arrays so you can use them in later steps (e.g. copy observations to comments, personalise messages, or run conditions on answers).

Use this action after a Booking Confirmed (or similar) trigger when you need to read the answers submitted during booking. The action does not modify the booking; it only adds answer data to the workflow context.


Configuration

Booking ID (Required)

The ID of the booking whose answers you want to load. Supports variables (e.g. {booking.id} from a trigger or a previous step).


Output

The action adds the following keys to the workflow context:

Key

Type

Description

booking_answers

array<string>

Booking-level question answers, 0-indexed list of strings.

guest_answers

array<array<string>>

Guest-level answers; index 0 = first guest's answers, index 1 = second guest's, etc.

extra_answers

array<array<string>>

Extra-level answers; index 0 = first extra instance's answers, index 1 = second, etc.

booking_answer_count

number

Number of booking-level answers.

guest_count

number

Number of guests with answers.

extra_count

number

Number of extra instances with answers.

Answer order follows question order. All values are normalised to strings (including multi-value answers, which are joined with , ).


Accessing Answer Data

Use variables for single values and array functions for lists.

Booking-level answers

{booking_answers} 
{first(booking_answers)}
{last(booking_answers)}
{get(booking_answers, 0)}
{join(booking_answers, ', ')}
{booking_answer_count}

Guest-level answers

  • guest_answers is an array of arrays: one array per guest (same order as guests on the booking).

  • Use get(guest_answers, 0) for the first guest’s answers, then first(), join(), etc. on that array.

{get(guest_answers, 0)} 
{first(get(guest_answers, 0))}
{join(get(guest_answers, 0), ' | ')}
{guest_count}

Extra-level answers

  • extra_answers is an array of arrays: one array per extra instance (quantity expands to multiple instances).

  • Use get(extra_answers, 0) for the first instance’s answers, then array functions as needed.

{get(extra_answers, 0)} 
{first(get(extra_answers, 0))}
{extra_count}

Examples

1. Copy first booking-level answer to comments (e.g. “Observations”)

Use after Booking ConfirmedGet AnswersUpdate Booking:

Booking ID: {booking.id} 
Comments: {first(booking_answers)}

(If “Observations” is the first booking-level question, this copies it into the booking comments.)

2. Join all booking-level answers into one string

{join(booking_answers, ' | ')}

3. Use a specific answer by index

{get(booking_answers, 0)} 
{get(booking_answers, 1)}

4. First guest’s first answer

{first(get(guest_answers, 0))}

5. Check if there are any booking-level answers

{empty(booking_answers)}

(Use in a condition: “is empty” vs “is not empty”.)

6. Full workflow: Booking Confirmed → Get Answers → Update Booking (observations to comments)

  1. Trigger: Booking Confirmed

  2. Action: Get Answers

    • Booking ID: {booking.id}

  3. Action: Update Booking

    • Booking ID: {booking.id}

    • Comments: {first(booking_answers)}


Array functions

The variable picker includes an Array category. Useful functions for Get Answers output:

  • first, last – first/last element of an array

  • get(array, index) – element at index

  • join(array, separator) – join array to string

  • empty(array) – whether array is empty

  • slice, pluck, contains, unique, sort, reverse, implode, explode, merge, flatten

Use these in expressions like {first(booking_answers)} or {join(get(guest_answers, 0), ', ')}.


Best practices

  1. Use after the booking exists – Run Get Answers after a trigger or step that provides booking.id (e.g. Booking Confirmed).

  2. Know your question orderbooking_answers order follows question order; use index 0, 1, … or first(), last() accordingly.

  3. Handle empty answers – Use empty(booking_answers) or check counts before using first()/get() in critical paths.

  4. Guest/extra orderguest_answers and extra_answers follow the booking’s guest and extra order; use get(..., index) for a specific guest or instance.

  5. Combine with Update Booking – Typical use is to copy one or more answers (e.g. observations) into the booking’s comments or another field via Update Booking.


Related documentation

Did this answer your question?