Skip to content

UX Prototyping & Protopie

  • Principles
    • Educational
    • Figma Integration
  • Patterns, Pitfalls, Ploys
    • Patterns
    • Pitfalls
    • Ploys
  • More …
    • People-Centered Design
    • Thinking about AI
  • Principles
    • Educational
    • Figma Integration
  • Patterns, Pitfalls, Ploys
    • Patterns
    • Pitfalls
    • Ploys
  • More …
    • People-Centered Design
    • Thinking about AI

Use Variables

Variables can sometimes feel a little clumsy, but they can make a big difference to simplifying your code. This is especially true if you also use “Detect” triggers and maybe even formula values for your variables.

For example, if you have a password input field you can have a variable that uses a ‘length’ formula to always have the value of the number of characters in the password. Using a detect on this variable enables you to trigger action when the password is 8 or more characters.

Achieving the same effect without a variable is tricky, but there are other good reasons to use variables – you can track their value in Preview mode and this can help you fix errors in your logic. If you rely just on properties of objects, tracking their value can be harder.

The contrasting position is that some classic variables are really not needed – for example, ‘status’ variables for toggling states can sometimes be avoided by simply inspecting the opacity of the relevant object. However, one advantage of using a 0 or 1 status variable is that the opacity of your on indicator can be set to a formula (status*100) which means you only need change the status variable and the change will be shown automatically.

Using a variable can also simplify the construction of conditionals. For example, this Pie (based on one by Alisa) uses a variable called match which reflects whether each password field is more than 5 characters and matches the other field. Using these means that one has one set of simple conditions for giving match a value and another set of simple conditions for responding once there is match (using a Detect trigger).

Inspecting this variable match makes it easy to see when the passwords match and when they don’t. The condition for highlighting the Create Account button simply checks the checkbox whenever the match is 1.

The wrong variable type

This pitfall is not a big deal, but it can waste you time as you try to track down why your variable seems to have the wrong value (or no value). It can also bite you in a formula where your variable is of the wrong type for the formula.

Why use Protopie?

There are many prototyping tools out there, so what makes Protopie special – how is it different?

How to inspect variables inside a component

Even all-Scenes variables are not accessible inside a component. And this can lead to hard to find errors when a variable with the same name is used in a component, but its value is not sync'd with the scenes.

Use Components

It will often seem as though it will be faster to use individual elements than to use components, but in the end the time saving almost always goes the other way.

Keep trigger and response names visible

It is very important to annotate your code with what it is actually doing, but keeping the trigger and response names helps someone new to the project (or you in three month's time.

Rough, Rapid, Right

Sending and receiving mismatched messages

You can send messages in different ways, but Protopie requires you to receive them in the matching way. A common (and easy) mistake is to send a message to a 'parent' while wanting to receive it from the current scene.

Playing with time

A message sent to the current scene will be received by the object that sent it. But a message sent to Protopie Studio (Connect) will not be received by the pie that sent it. B ut what if there is nothing out there to respond to it?

Origami Studio, Figma and others

Receive and Assign hazard

parseJson gives no error message

Playing with time

Use Components

Distinctive initial variable values

  • Welcome
  • What’s New?
  • About
  • Welcome
  • What’s New?
  • About

info@peoplecentereddesign.org

© 2026 David Gilmore