# Troubleshooting & FAQ (/docs/products/ussd-flows/troubleshooting)

## Common Issues

### "Invalid JSON" in the Editor

The flow has a JSON mistake, such as a missing comma or bracket, or it breaks a flow rule, such as a missing field or a misspelt one. Hover over each red line to see what's wrong.

Common causes:

- A component without a `type`.
- A `type` that isn't one of the six page types: `prompt`, `menu`, `display`, `dynamic`, `template` or `side_effect`.
- A misspelt field, such as `lable` for `label`.

If the message mentions "unevaluated properties", a field isn't allowed on that page type. Check the [Flow Definition](/docs/products/ussd-flows/developers/flow-definition).

### The Draft Isn't Saving

The editor doesn't save while the status reads "Invalid JSON". Fix the red lines first. If it reads "Unsaved", the editor saves 5 seconds after you stop typing, or press Ctrl+S (Cmd+S on Mac). If you're looking at **Published**, switch to **Draft**: the live version is read-only.

### Publish Is Greyed Out

Hover over **Publish** to see why. The messages are listed in [Editing & Publishing](/docs/products/ussd-flows/editing-and-publishing#publishing).

### "Publish Draft" Is Missing on the Flow's Page

It only shows when there is a saved draft. Publishing clears the draft, so the button comes back after your next saved change.

### "Action Required" in the Security Section

The flow calls your server but has no public key, so you can't publish it. Add a key as shown in [Flow Security](/docs/products/ussd-flows/security).

### A Variable Shows Nothing

**$(page.\*.value) is empty**

- The page id doesn't match any `id` in your flow. Check the spelling and capitals.
- The caller hasn't reached that page yet. You can only use answers from pages they've already passed.
- The caller skipped that page because the flow jumped past it.

**$(session.\*) is empty**

Only these names work: `id`, `network_name`, `network_provider_name`, `subscriber_id` and `subscriber_msisdn`. Any other name is empty.

**$(data.\*) is empty**

This data comes from your server's reply to an exchange or a dynamic page. It is empty if that call hasn't happened yet, or if the reply didn't include the field.

### A Menu Shows No Options

For a fixed list, `items` must hold 1 to 16 entries, each with a `value` and a `label`.

For a list from your server, such as `"$(data.districts)"`, the data must be a list of `{ value, label }` entries by the time the menu shows. If your server hasn't sent it yet, the menu is empty.

### Callers Keep Getting "Invalid Input"

The prompt's rules may be too strict.

- For text, check `min_length`, `max_length` and `pattern`. Try the pattern with real answers.
- For numbers, check `min_value` and `max_value`.
- Set `max_invalid_input_attempts` to about 3, so one typo doesn't end the session.

### My Server Isn't Called

Check that the page has an `on_done` with `"action": "exchange"` and a full `url` that can be reached over the internet. Without it, the flow moves to the next page and doesn't call your server.

### The Session Ends With an Error

Your server must reply with HTTP 200 within 10 seconds, with an encrypted reply. Any failure ends the caller's session with an error. See [Security Troubleshooting](/docs/products/ussd-flows/developers/security/troubleshooting) for reply problems.

***

## Frequently Asked Questions

### Codes

**Can two flows share a code?**

No. Each flow has its own code and, if you ask for one, its own short code.

**Can I choose my own code or short code?**

No for the code: Monime picks it when you create the flow. For a short code, email [Monime support](mailto:support@monime.io). See [Codes and Short Codes](/docs/products/ussd-flows#codes-and-short-codes).

### Editing and Publishing

**What happens if I close the editor without saving?**

Edits from the last 5 seconds may be lost, and anything with "Invalid JSON" is never saved. Press Ctrl+S (Cmd+S on Mac) before you close.

**Can I edit the live version directly?**

No. Edit the draft, save it and publish.

**Can I go back to an earlier version?**

Not from the dashboard. Before a big change, copy the live flow as shown in [Editing & Publishing](/docs/products/ussd-flows/editing-and-publishing#going-back-to-an-earlier-version). To go back, paste it in and publish.

**How fast does publishing work?**

New sessions get the new version straight away.

### Screens

**How long can a label be?**

Phones show at most 130 characters of a label, after variables are filled in, and 64 for a menu item. The rest is cut off, so keep screens short.

**How many options can a menu have?**

1 to 16. For more, split them across two menus.

**Can I use bold or other formatting?**

No. USSD screens are plain text. Use `\n` for a new line.

### Building Flows

**Can the next screen depend on the caller's answer?**

Yes. Use `on_done.next_page` to jump to another page. It can be an expression that picks the page from the answer. Your server can also decide, through an exchange or a dynamic page. See the [Flow Definition](/docs/products/ussd-flows/developers/flow-definition).

**Should I use one flow or many?**

One flow per service. See [Naming and Organising Flows](/docs/products/ussd-flows/managing-flows#naming-and-organising-flows).

**Can I delete a flow?**

No. Disable it instead. See [Managing Flows](/docs/products/ussd-flows/managing-flows#disabling-and-enabling-a-flow).

## Contacting Support

If you're still stuck, especially if a published flow can't be reached, email [Monime support](mailto:support@monime.io) with:

- the flow ID and code
- the flow JSON, if it matters
- the error message
- the steps that cause the problem
