Mestra Topos
Get started with Topos
This page takes you from an empty Topos to a table with data and a first decision. Steps 1 to 4 need the Owner role. Everyone can follow along by reading.
Before you start
- Mestra Topos must be on for your organisation. See the overview.
- For the decision in step 6, you need a campaign with dynamic variants and approved rules. See Dynamic variants.
1. Open Topos
Open topos.withmestra.com, or choose Mestra Topos in the app switcher. A new organisation sees Start here with three steps. Select Upload a file to start.
2. Upload a file
Make a CSV file called menu.csv with a header row:
item,price,availableFlat white,4.50,trueCheese scone,5.95,trueLong black,4.00,false- On the Data page, select Upload a file.
- In step 1 of 3, drop
menu.csvon the drop zone or choose it. Mestra reads it and shows its columns. - In step 2 of 3, check what Mestra read. Enter a Dataset name, such as
Menu. The Dataset key fills in asmenu. You can change the key. It must start with a lower-case letter. - Look at each column. Keep is ticked, and the type is guessed:
itemis Text,priceis Number,availableis True/false. Choose the key column, hereitem, so each row is identified by its item name. With No key: use the row number, a row is identified by its place in the file. - Under When the file is uploaded again, choose Add and update or Replace everything. The choice is kept with the connector. See Upload a file.
- Select Create dataset.
Step 3 of 3 shows what happened: Applied, Unchanged, Gone and Refused. For this file it shows 3 applied and 0 refused. Select Done.
Money is different. If a column holds prices, set its type to Money, enter a three-letter currency such as AUD, and make the cells whole cents: 450, not 4.50. A cell with a decimal in a money column is refused. See Tables.
3. Look at the table
Select Menu on the Data page. The table viewer shows the rows. Select a row to see it in full. Use Filters, Sort and Columns to change the view. See Tables.
4. Keep it up to date
A file upload makes a table and a connector of the same name, and it reads the file once. The Topos pages don’t offer a way to upload a later file into the same table. To keep a table up to date, add a connector that brings data in on its own:
- Your system sends data to Mestra: Send data to Mestra.
- Mestra fetches a web address every so often: Fetch data on a schedule.
On the Ingest page, select Add a connector and follow the five steps: Type, Connector, Configure, Test and Save and schedule. See Connectors.
5. Check that it works
Open the connector. Past runs lists every run with its outcome and how many rows it brought in. What has landed lists each payload that arrived. A connector that works shows Healthy on the Ingest page. See Runs, history and replay.
6. Write a first decision
A decision chooses which variant of a campaign a screen shows. You can start with one that always shows the default variant, and then change it.
-
Open Decisions and select New decision.
-
Enter a Key, such as
morning, and a Name. Choose the Campaign. A decision stays with its campaign. -
The editor starts with:
Python def decide(ctx):# Choose a row with show(row_id, "why"). ctx.default is the default row.return show(ctx.default, "the default") -
Change it to show a variant on weekday mornings. Replace
breakfastwith the id of one of your campaign’s variants:Python def decide(ctx):if in_window(ctx.time, "06:00-11:00") and in_days(ctx.day, "mon,tue,wed,thu,fri"):return show("breakfast", "Weekday morning")return show(ctx.default, "Default") -
Select Save. Mestra says “Saved as version 1.” A saved version isn’t live yet.
-
Under Test, optionally choose a Screen and a Time, and select Run test. Mestra shows the Row chosen, the reasons, and what the decision saw.
-
Under Versions, select Make live on version 1, and confirm. Screens follow it from now on.
To stop, select Take down on the live version. Screens go back to the table. See Test, go live and read the log.