web replace

This block is part of the web group and was last modified in core v15.0.1.

web replace v15.0.1

Replaces one element of the page (a row, a card, a button) with new HTML, rendered on the server.

In pins 3 + flow
  • flow
  • key value

    The element's data-key: a row of web for each, or the key a web action received.

  • target value

    A CSS selector instead of a key, e.g. #cart-count.

  • html value required

    The new HTML, e.g. from web template.

Out pins 0 + flow
  • flow

Adds a browser update to the web action's answer: the element is replaced by `html` (outerHTML, so the new markup is the element itself; when it has no data-key the browser keeps the old key on it). Addressed by `key` (matches [data-key="<key>"]) or, when key is empty, `target` (a CSS selector); neither is an error that stops the flow. Only in a flow started by web_action (an error elsewhere). Updates apply in the order the blocks ran.

rerender row
swap html
update row

web replace swaps one element for new HTML, outer tag included. Here a subscribe form stores the address with create document, and the form itself is found by a CSS selector on the target pin and replaced by a thank you. To replace one row of a table, wire the key of on web action into the key pin instead: target is only used when key is empty, and neither of them is an error that stops the flow.

Studio canvas example for the web replace block: swapping a form for a thank you.

Used in these guides

These documentation pages use or explain this block:

Version history

Introduced in v15.0.1.

  • v15.0.1: block added in this release.

Back to web Return to the main group to view all sub-groups Back to web actions Return to the group to view all blocks within this group