Logique et données
Reuse answers, send callers down different paths, show live data from your systems, and reuse other apps.
La documentation est rédigée en anglais. Les pages traduites arrivent.
Saved answers (variables)
Every answer saved with Save the answer as, every value saved from an API, and a few built-in values can be used anywhere text is typed: screen text, API addresses, request bodies and conditions.
| Write | Becomes |
|---|---|
{{amount}} | The answer saved as amount, e.g. 50 |
{{MobileNumber}} | The caller’s phone number |
{{SessionId}} | The session’s unique id, handy for matching payments |
{{amount}}. In Smart Router conditions, write the plain name: amount > 100.Smart Router
Sends the caller down different paths depending on a value, without showing them anything. For example: balances over GHS 100 go to one screen, everything else to another.
Add a Smart Router
Click Smart Router in the toolbox and connect the previous screen to it.Write a condition
Open its Branches section and type a condition likebalance > 100. The small buttons under the box insert operators for you.Add a fallback branch
Add one more branch and turn on Use when nothing else matches. It catches every caller no other branch matched. Always add one: without it, a caller who matches nothing hits an error.Connect each branch
Each branch gets its own dot on the router. Drag each one to the screen it should lead to.
| Operator | Example | True when |
|---|---|---|
== / != | network == MTN | equal / not equal |
> < >= <= | amount >= 10 | comparing numbers |
contains | name contains Mensah | the text includes it |
startsWith / endsWith | phone startsWith 024 | the text begins / ends with it |
AND / OR | age >= 18 AND status == active | both / either are true |
- Branches are checked in order; the first true one wins.
- Write the saved answer's name first, then the operator, then the value, with spaces between:
name contains Mensah. Quotes around the value are optional. - Text comparisons ignore upper and lower case.
- Use either AND or OR in one condition, not both. For more complex rules, chain two Smart Routers.
- A condition about an answer that was never saved is false, so that caller goes to the fallback branch.
Send Data
Calls your system (any web API) in the middle of a session, for example to look up a balance or register a customer, and saves values from the reply for later screens. The caller sees nothing while it runs.
Add Send Data and open its settings
Click Send Data in the toolbox, then open the Request section.Enter the address
Choose the method (GET to fetch, POST to send; your API's documentation says which) and type the address. You can put saved answers in it:API URLhttps://api.example.com/customers/{{MobileNumber}}/balanceAdd a body (POST, PUT or PATCH)
Type the JSON to send. Saved answers work here too:Request body{ "phone": "{{MobileNumber}}", "amount": "{{amount}}" }Add headers if your API needs them
For example anAuthorizationheader with your API key.Save values from the reply
Under Save From Response, press Add and pair a path in the reply with a name. If your API answers:thenYour API's reply{ "data": { "balance": 125.50, "name": "Ama" } }$.data.balance→balancelets a later screen say:Hi Ama, your balance is GHS 125.50.
balance >= 0) and a Use when nothing else matches branch that leads to a friendly "Please try again later" screen.For safety, Send Data only calls public internet addresses, never private or local network addresses.
Sub-flow
Runs another of your published apps inside this one, then comes back. Build a common piece once, such as registration, and reuse it in several apps.
Publish the app you want to reuse
Only published apps can be used as sub-flows.Add a Sub-flow screen
Click Sub-flow in the toolbox, open it, and choose the app under App to run.Pass values in and out (optional)
Inputs passed in copies values into the sub-flow; Outputs passed back copies answers back out, for example the sub-flow'snameinto this app'smemberName.Connect what comes next
When the sub-flow reaches its end, the caller continues at the screen connected after the Sub-flow screen.
Example
A "Member hub" app runs your "Register" app as a sub-flow, then greets the caller by the name they just entered:
Back in the hub. Welcome, Akua Mensah!