Skip to content

Store a value from a request in a variable and show it

A request gets a value, such as the weather or an exchange rate, from a web service during playback. It stores the value in a variable, and any text that contains that variable shows it. Here you build a screen that gets the current temperature in Seoul when the scene opens and shows it.

How-toAdvancedAbout 6 minInteraction mode

Make a place to show the value

Start with one empty scene. The value you get goes into a variable and shows in any text that contains that variable. Variables explains the kinds of variables and where you can use them.

  1. Create a variable

    Click the tag-shaped Variables button, the second in the button row at the top right. The Variables panel opens. Click the + Add Variable button in its title bar. A “New Variable” row appears, and its name field is ready for typing.

    Clicking Add Variable adds a “New Variable” row with its name field ready for typing. Video: Clicking the tag-shaped Variables button at the top right opens the Variables panel. Clicking the + button in its title bar adds a “New Variable” row with the name field ready for typing.
  2. Give it a name and a first value

    Type “Temperature” and press ↩. Click the value field in the same row, type “Loading”, and press ↩. This value shows until the response arrives.

    The name changes to “Temperature” and the value to “Loading”. Video: Typing Temperature in the name field and pressing Enter names the variable. Clicking the value field in the same row, typing Loading, and pressing Enter sets its first value.
  3. Put it in text

    Click the T-shaped Insert as text button on the right of that row. A text containing {⁠{Temperature}⁠} appears in the center of the scene. Press esc, and “Loading” shows in its place.

    Clicking Insert as text adds a text with the token in the center of the scene, and pressing esc shows “Loading”. Video: Clicking the T-shaped Insert as text button on the right of the Temperature row adds a text with the variable token in the center of the scene, and pressing Esc shows “Loading”.

Send a request when the scene opens

Press ⇧I to switch to Interaction mode, and click an empty spot on the canvas to clear the selection. When the title of the Interactions panel below shows the scene name and “· Scene”, as in “New Scene · Scene”, the sentence you make now belongs to the scene.

This example asks the weather service Open-Meteo for the current temperature in Seoul. For non-commercial use, Open-Meteo is free and needs no API key. Here is the address:

https://api.open-meteo.com/v1/forecast?latitude=37.57&longitude=126.98&current=temperature_2m

  1. Make a request sentence

    Click Make your own below the recipes on the right of the panel, and choose Fetch from the menu. The sentence “On click → Fetch GET https://api.example.com/” appears in the list. The Request panel opens with it.

    Choosing Fetch from Make your own adds a sentence and opens the Request panel. Video: In the scene’s Interactions panel, clicking Make your own and choosing Fetch adds the sentence “Fetch GET https://api.example.com/” and opens the Request panel.
  2. Paste the address

    The URL field in the Request panel opens with its address selected. Copy the address above, paste it, and press ↩. The sentence in the editing column on the right shows the new address. In the list row, a long address appears shortened.

    Pasting the new address over the selected one and pressing ↩ updates the sentence in the editing column. Video: Pasting the Open-Meteo address into the selected URL field and pressing Enter changes the sentence in the editing column on the right to “Fetch GET https://api.open-meteo.com/…”.
  3. Choose the value to get

    Click Add value under Into. A row appears with an empty path field and “→ Temperature”. Click the path field, type $.current.temperature_2m, and press ↩. This puts the temperature_2m value inside current in the response into “Temperature”.

    Clicking Add value adds a “→ Temperature” row, and clicking the path field lets you type the path. Video: Clicking Add value under Into adds a row with an empty path field and “→ Temperature”. Clicking the path field, typing $.current.temperature_2m, and pressing Enter sets the path.
  4. Change the trigger

    Click “On click” at the start of the row in the list, and choose On scene enter. Now the request goes out every time the scene opens.

    Clicking “On click” and choosing On scene enter changes the start of the sentence. Video: Clicking “On click” in the list row and choosing On scene enter changes the sentence to “On scene enter → Fetch GET … into Temperature”.
  5. Check it in preview

    In Studio, press ⌘S to save first. Then click the triangle-shaped Preview button in the panel’s title bar. After a moment, “Loading” changes to the current temperature, such as 25.5.

    With Preview on, “Loading” changes to the current temperature after a moment. Video: Clicking the triangle-shaped Preview button in the Interactions panel’s title bar changes “Loading” to the current temperature, such as 25.5, after a moment.
  6. Read the log

    During preview, a Log column appears on the right of the panel. Hover over the top line to see the whole line. The “200 · 317 B · 1077 ms” at the end is the status, size, and time taken. If a dimmed line shows “skipped”, see Handle failed requests. Press esc to end the preview, and the text returns to “Loading”.

    Hovering over the top log line shows the whole line ending in “200 · 317 B · 1077 ms”, and pressing esc brings back “Loading”. Video: Hovering over the top line of the log shows the whole line ending in 200 · 317 B · 1077 ms. Pressing Esc ends the preview and brings back “Loading”.

Typing after Add value doesn’t go to the path field

When the new row appears, the cursor isn’t in the path field. If you just type, the letters run as canvas shortcuts and change the tool, and Tab switches the edit mode. Click the path field first, then type. If the mode changed, press ⇧I to go back to Interaction mode.

How to write a path

Paths, the value each one stores in the variable, and the response it reads
PathValue storedResponse
$.current.temperature_2m25.5 · Each period (.) goes one level deeper{"current": {"temperature_2m": 25.5} }
$.items[1].nameB · Positions in a list count from 0{"items": [{"name": "A"}, {"name": "B"}]}
temp18.4 · You can leave out the leading $.{"temp": 18.4}
$["max temp"]30 · If a name has a space or a period, write it in brackets and quotes{"max temp": 30}
Leave emptyThe whole response · Here the response doesn’t have to be JSONAny text

Getting several values and adding a unit

Tip

To get more than one value. Create another variable, and click Add value again. The new row has the first variable chosen, so choose the new variable from the row’s variable list and type its path.

Tip

To add a unit after the token. Double-click the text, and it opens with the token selected. Press → to move the cursor after the token, and type °C. If you type right over the token, the text loses its link to the variable.

Send values with variables

If you closed the Request panel, click GET in the sentence (or the method’s name, if you changed it) and choose Edit request. The panel opens again.

You can put variables in the address, Headers, and Body. Wrap a variable name in double curly braces, like {⁠{city}⁠}, and it’s replaced with the variable’s current value when the request goes out. In the address, a variable can go only after the domain.

To send values, choose POST, PUT, PATCH, or DELETE in Method, and type what to send in Body. GET doesn’t send a body. To send JSON, click Add header and type content-type as the name and application/json as the value.

The URL field accepts only http and https addresses. If you enter an address with a port number or a user name, or one with a variable in the domain, the field goes back to the previous address.

AI doesn’t create or change requests. That goes for the AI Assistant, and for Claude and ChatGPT linked through Connect an AI app (MCP). Write requests yourself in the Request panel.

Viewers can see the keys in your requests

A request’s address, headers, and body are saved in the document as they are, and the browser of anyone watching through a play link receives this document too. That is what the notice in the Request panel and the “Request headers are visible to every viewer” line under a sentence with headers mean. Use only keys that are safe to make public. Every address this project sends requests to is listed in the “Requests go to” line at the bottom of the Scene tab in the Interactions panel.

Handle failed requests

When a request fails, the variable keeps its previous value. A dimmed line appears in the log, and when you hover over it, “skipped (reason)” shows at the end of the line. The table below lists what to do for each reason, and Edit and preview explains how to read the log.

Set what happens on failure under On error in the Request panel. Click Add action and choose an action. When the request fails, those actions run in order: going to a notice scene, for example, or leaving a mark in a variable.

A set-value action under On error has no field for typing a value. It takes the value the variable has when you choose the action. To show “No data” on failure, change the value of “Temperature” to “No data” in the Variables panel. Then choose “Set Temperature to…” under On error, and change the variable’s value back to “Loading”.

The value on failureClicking Add action and choosing “Set Temperature to…” adds a row that holds the value at that moment, “No data”. Video: With the variable’s value changed to “No data”, clicking Add action under On error and choosing “Set Temperature to…” adds the row “Set Temperature to No data”.
Reasons for a failed request in the log, and what to do
Reason in the logMeaningWhat to do
Request address is not in the saved projectIn Studio, requests go out through the SSHOW server, and the server sends only to addresses written in the saved project. The address you just entered isn’t saved yet.Press ⌘S to save, and start the preview again.
Requests are turned offRequests are turned off on this site.A site admin has to turn requests on before you can send them. Until then, the actions under On error run instead, so leave a notice there.
Requests need an app updateThe project was opened from a file on the device in the desktop or tablet app. The current app can’t send requests from here.Open it as a project in Studio to test it.
Request address is blockedA place requests must not go, such as a private address like your own computer or a company network, or SSHOW’s own address. In the Playground, marked “Playground” at the top, addresses that aren’t https are blocked too.Use the https address of a public service.
Request was redirected elsewhereThe service redirected the request to another address that isn’t in the saved project, or redirected it more than three times.Open the address in a browser, check the address it finally lands on, and use that address.
Request failedThe service answered with a failure status such as 404 or 500, or no connection was made. If a response came back, its status code is on the line just below.Check the address and headers. In the Playground, requests go out straight from the browser, so they can’t reach services that don’t accept requests from browsers.
Request timed outNo response came within 10 seconds.Try again later, or use another service.
Response is too largeThe response is larger than 1 MB.Use an address that returns only the values you need.
Response is not JSON or textThe response is in a format such as a web page (HTML) or an image.Use an API address that responds with JSON or text.
Response is not JSONYou entered a path, but the response isn’t JSON.Clear the path, or use an address that responds with JSON.
Response has no such valueThe spot the path points to isn’t in the response.Open the address in a browser to see the response, and check the capitalization of names and positions counted from 0.
Not a number · Not a colorA Number variable got a value that isn’t a number, or a Color variable got a value that isn’t a color like #FF0000.Fix the path, or change the variable’s type to String.
Too many requestsMore than 4 requests went out at once, or more than 60 in a minute. It also shows when so many viewers are watching that the server reaches its limit.Check that no sentence that starts when a variable changes, like “When Temperature changes”, is repeating the request.
Was this page helpful?

Updated 10/12/2026 · The videos on this page were recorded in the current editor.

Popular