Get started: HTTP POST on tap
This tutorial builds on Get started: HTTP GET. You keep the same data piece that shows a product title, add an HTTP data destination for a POST request, and set up a chain of tap actions: show progress while the request runs, POST to DummyJSON, and show a short confirmation with Apply value. The wait indicator clears when the list finishes. Stop wait animation is optional if you want to hide it earlier.
DummyJSON simulates the POST — it returns a created product with a new id but doesn't actually store it.
Before you begin
Complete Get started: HTTP GET so you have:
- One data section
- One HTTP data source fetching
https://dummyjson.com/products/1 - One data piece with a Label that shows the product title through a Simple expression transformer (
value?.title)
1. Create an HTTP data destination
Open the menu (top-right) → Data destinations → Add data destination.
On the "New data destination" screen:
- Name —
HTTP POST DEST - Type — HTTP
- Open the first HTTP request in the Actions / Transformers pipe. Leave method as POST.
- URL — the DummyJSON add-product address:
https://dummyjson.com/products/add
Leave Body, headers, and other request settings empty for now — your tap actions will supply the request body.
Tap the save tick in the top-right.
See Data destinations (outgoing) for the full list of HTTP options. Destination URL and Text to send can include {{ value?.field }} when the tap runs. To POST from this data piece without creating a destination, add HTTP request under Data actions instead — see Tap actions.
2. Open the data piece editor
On the home screen, turn on Edit layout, tap the product-title data piece, then tap its menu button and choose Edit.
Select the Label, then set Touches to Capture so taps on the Label run these actions. Labels default to Pass through, which does not receive taps.
Open Events, then On tap. Tap a row to edit an action, drag the handle to reorder, and swipe right to left to delete one.
3. Add a wait indicator (progress)
Tap Add... → under UI actions, choose Wait animation.
This shows a wait indicator over the Label while the later actions run, including the HTTP POST. The defaults are fine. Incoming data from the source does not clear it.
The wait always clears when this tap list finishes — including Stop pipeline, a cancelled prompt, or a failure. Stop pipeline if failed is on unless you turn it off, so a server error stops later actions and the wait clears when the list stops. Stop wait animation can hide it earlier.
See Tap actions — Wait animation.
4. Build the POST body from the displayed title
Tap Add... → under Data actions, choose Lua.
Enter a one-line script that wraps the current value (the product title on the data piece) into JSON for the API:
return {title = value}
At tap time, value is the data piece's current display value — here, the title string from your Simple expression transformer.
Alternatively, under Data actions, choose Simple expression instead of Lua:
raw— passes the full product JSON from your HTTP data source (already an object).- JSON text — for example
'{"title": "BMW Pencil"}'. When a Simple expression result is a string that looks like JSON (starts with{or[), the app turns it into an object or array for the next action. See Expressions — JSON-looking results.
See Lua for the tap names (value, raw, transformed, ctx).
5. Trigger the HTTP POST
Tap Add... → under Data actions, choose Trigger data destination.
Set:
- Data destination —
HTTP POST DEST - Text to send — leave it empty so the app sends the current value (the Lua table from the Lua action)
- Apply result to pipeline — on
When the POST succeeds, the response is parsed as JSON and becomes the new value for the next action.
6. Show a confirmation with Apply value
Tap Add... → under Data actions, choose Apply value.
In Value, enter:
New product added
Don't leave Value empty (From pipeline) here — use this text instead of the POST response from the previous action.
Apply value shows that text on the Label as-is. It does not run the Label's transformers (value?.title from Get started: HTTP GET). Put the confirmation you want to see, not JSON that you expect a transformer to unpack.
The confirmation stays on the data piece until your HTTP data source fetches again on its usual schedule (from Get started: HTTP GET); then the data piece goes back to the product title. An optional Timeout (ms) can clear it sooner.
7. Optional: hide the wait before the list ends
The wait indicator always clears when this tap list finishes, so you do not need Stop wait animation for a normal POST. Add it only if you want to hide the wait earlier — for example so the confirmation from Apply value is not covered while later rows still run.
If you do add it: tap Add... → under UI actions, choose Stop wait animation.
See Tap actions — Stop wait animation.
Save the data piece.
Your tap actions, in order:
| Category | Action | Role |
|---|---|---|
| UI actions | Wait animation | Shows progress while the POST runs |
| Data actions | Lua | return {title = value} — builds the POST body |
| Data actions | Trigger data destination | Sends the POST; applies the JSON response as the new value |
| Data actions | Apply value | Shows New product added on the Label |
| UI actions | Stop wait animation (optional) | Hide the wait before the list finishes |
8. Tap the Label on the dashboard
Back on the home screen, tap the Label (the product title). Tapping elsewhere on the data piece does nothing.
- A wait indicator appears over the Label while the POST is in flight.
- When the POST completes, Apply value shows New product added.
- The wait indicator clears when the list finishes (or earlier if you added Stop wait animation).
- That confirmation stays visible until your HTTP data source fetches again and updates the data piece back to the product title.
DummyJSON doesn't actually save new products — the response is for testing only.
Using the HTTP response
This tutorial turns Apply result to pipeline on (so later actions can use the POST response) and shows a fixed confirmation with Apply value. Other common patterns:
| Goal | What to do |
|---|---|
| Post and forget | Trigger data destination with Apply result to pipeline off; stop there, or add only UI feedback (for example Wait animation) |
| Extract a field | After the trigger, add JSONPath (for example $.value.id) or Simple expression (for example value.id) under Data actions |
| Transform | Lua or Simple expression to reshape the response before the next action |
| Show on the data piece | Apply value with the text to show (as in step 6), or From pipeline. That text is shown as-is — transformers do not run again |
| Send elsewhere | Another Trigger data destination (HTTP, MQTT, or WebSocket) using the response as the body |
| Refresh incoming data | Trigger data source(s) on this data piece's HTTP source, or on a different source |
Each action can change value for the next one. The value shown by Apply value stays until new data arrives from the data source, or sooner if you set a timeout.
Chaining sources and destinations
A single tap can trigger multiple data sources and destinations — for example POST to one API, extract an id from the JSON, publish it over MQTT, then Trigger data source(s) to refresh the data piece.
Pick several sources in one Trigger data source(s) action to refresh them at the same time, or add separate Trigger data source(s) and Trigger data destination actions, with JSONPath, Simple expression, or Lua in between whenever the data needs to change shape.
What you built
| Part | Role |
|---|---|
| HTTP data destination | Sends an outbound POST to https://dummyjson.com/products/add |
| Wait animation | Shows progress while the tap actions run |
| Lua | Builds {title: …} from the displayed title |
| Trigger data destination | Sends the POST and feeds the JSON response into the next action |
| Apply value | Shows New product added on the Label until new data arrives (or a timeout you set) |
| Stop wait animation | Optional. Hide the wait before the list finishes. The list also clears it when it ends. |
Next steps
- Tap actions — full action reference, including HTTP request (this component only) and Trigger data destination (reusable). Both can use
{{ value?.field }}. - Data destinations (outgoing) — MQTT, WebSocket, and reusable HTTP outbound
- Get started: HTTP GET — incoming HTTP data and transformers
- Typical setup flow — recommended order for larger dashboards