Skip to content

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:

csv
item,price,available
Flat white,4.50,true
Cheese scone,5.95,true
Long black,4.00,false
  1. On the Data page, select Upload a file.
  2. In step 1 of 3, drop menu.csv on the drop zone or choose it. Mestra reads it and shows its columns.
  3. In step 2 of 3, check what Mestra read. Enter a Dataset name, such as Menu. The Dataset key fills in as menu. You can change the key. It must start with a lower-case letter.
  4. Look at each column. Keep is ticked, and the type is guessed: item is Text, price is Number, available is True/false. Choose the key column, here item, 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.
  5. 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.
  6. 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:

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.

  1. Open Decisions and select New decision.

  2. Enter a Key, such as morning, and a Name. Choose the Campaign. A decision stays with its campaign.

  3. 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")
  4. Change it to show a variant on weekday mornings. Replace breakfast with 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")
  5. Select Save. Mestra says “Saved as version 1.” A saved version isn’t live yet.

  6. 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.

  7. 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.

Next