> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voxworks.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SMS | Get Value - v0.1

> The composite tool that collects one value by SMS round-trip mid-call (a registration, policy or reference number the caller can type more easily than say), with an optional format check.

## What it does

**SMS | Get Value - v0.1** collects one value by text message, for details that are easier to type than to say: a vehicle registration, a policy or claim number, a booking reference. In one step it:

1. speaks an **Opening Line** asking whether the caller can reply to a text,
2. sends the **SMS Text** to **Recipient Mobile**,
3. waits for the reply, keeping the conversation going while it does,
4. reads the reply, picks out the value described by **Value Description**, and checks it against **Format Pattern** if you set one, and
5. speaks a **Success Line** that confirms the value, or a **Failure Line** or **Not Received Line** if it couldn't be collected.

It is a [composite tool](/tools/composite-tools): the whole exchange runs behind a single step. It uses the platform SMS service, so no integration needs to be connected. It works like [SMS | Get Valid Email](/tools/composite/sms-get-email), but for any value rather than an email address.

The recipient must be an Australian mobile (04 / +614). The round-trip can't run to a landline or an overseas number, so treat the value as optional if your calls may reach those.

***

## Inputs

| Setting                | Description                                                                                                                                                                                                                                                                                                     | Default                                                                                                   |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| **Opening Line**       | Spoken word for word before the text is sent. It should say a text is coming (or ask whether the caller can reply to one) and name the value. End it with a question mark so the assistant waits for the answer.                                                                                                | "We just need to get one more detail. Are you able to use your phone to reply to a text message with it?" |
| **Recipient Mobile**   | The mobile the text is sent to and replies are read from. Must be an Australian mobile. Typically `{{contact.phone}}` (string, e.g. `+61412345678`). Required.                                                                                                                                                  | —                                                                                                         |
| **SMS Text**           | The body of the text. Say plainly which value the caller should reply with.                                                                                                                                                                                                                                     | "Please reply to this message with the detail we asked for."                                              |
| **Skip If Set**        | A variable reference. If it already holds a real value, the step ends at once with a true result and nothing is spoken or sent. Point it at the variable you map **Value** to.                                                                                                                                  | —                                                                                                         |
| **Failure Line**       | Spoken word for word when the value can't be collected because the caller can't text, declines, or the send fails.                                                                                                                                                                                              | "No worries at all - we'll leave that for now."                                                           |
| **Success Line**       | Spoken word for word when the value is collected. May include `{{sms.value}}` to read the value back.                                                                                                                                                                                                           | A varied confirmation that reads `{{sms.value}}` back                                                     |
| **Context**            | Optional background the assistant can use to answer questions about why the value is needed, or share when it helps.                                                                                                                                                                                            | —                                                                                                         |
| **Not Received Line**  | Spoken word for word when the caller says they replied but no usable value arrived.                                                                                                                                                                                                                             | "It doesn't look like your reply has come through yet - we'll leave that for now."                        |
| **Value Description**  | The value being collected, in lower case, for example `registration number` or `policy number`. It is spoken in the waiting lines and tells the tool what to look for in the reply. Required.                                                                                                                   | —                                                                                                         |
| **Format Pattern**     | An optional regular expression the value must match before it is accepted. Start it with `^` and end it with `$`, for example `^[A-Za-z0-9]{6}$` for exactly six letters and digits. Leave it empty where no single pattern fits (for example, Australian registrations); then any non-empty value is accepted. | —                                                                                                         |
| **Extraction Context** | Optional guidance on how to pick the value out of the reply, such as its shape and what to ignore. For example: "Australian vehicle registration: 1-7 letters and digits, ignore spaces, hyphens and the word 'rego'; return it uppercase." It is never spoken.                                                 | —                                                                                                         |

The default Success Line already reads the value back, so don't add a second confirmation step after the tool.

***

## Outputs

| Output            | Description                                                                                                   |
| ----------------- | ------------------------------------------------------------------------------------------------------------- |
| **result**        | Hidden boolean that routes the step. True when a value was collected (or Skip If Set fired).                  |
| **Value**         | The value from the reply. Map it to a durable variable, for example a custom variable, in **Output mapping**. |
| **Result Reason** | Why the step finished. Empty on success.                                                                      |

## Variables this tool writes

| Variable                | Type   | Example        | Description                                                                                                                                                                                                                                                                                                                                   |
| ----------------------- | ------ | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{{sms.value}}`         | string | `ABC123`       | The value collected from the SMS reply, the source of the **Value** output.                                                                                                                                                                                                                                                                   |
| `{{sms.result_reason}}` | string | `not_received` | Empty on success. On failure: `declined` (the caller can't or won't reply by text), `not_received` (the caller said they replied but no usable value arrived), `send_failed` (the text couldn't be sent), `no_value` (the caller doesn't have the value) or `switch_to_voice` (the caller offered to say it out loud or reply later instead). |

The `sms` namespace is shared with the other SMS tools, and a later SMS step can overwrite it. Map **Value** onto a durable variable rather than reading `{{sms.value}}` in later steps.

***

## Routing and wiring tips

* **true**: the value was collected (or skipped because it was already set). **Otherwise**: it wasn't. Branch on `{{sms.result_reason}}` to word the follow-up. For example, don't ask for the value again after `no_value` (the caller doesn't have it), and after `switch_to_voice` you can collect it by voice with [Data Collection - Alphanumeric](/tools/composite/data-collection-fields).
* Point **Skip If Set** at the same variable **Value** is mapped to, so repeat visits skip cleanly instead of texting the caller again.
* The tool speaks its own success and failure lines. Don't script another acknowledgement on the very next step.

***

## Next Steps

* [SMS](/tools/sms/overview) — the SMS tools and the `sms` namespace
* [SMS | Get Valid Email](/tools/composite/sms-get-email) — the same round-trip, for email addresses
* [Composite Tools](/tools/composite-tools) — how composite steps run and write their outputs
* [Variables](/flows/variables#sms) — every `sms` variable
