PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

HTML Manipulation

Sets an attribute on an HTML element, or adds a new child element to it, using XPath to find the element.

The HTML Manipulation action changes an HTML text. You point at an element with an XPath expression, then either set one of its attributes (for example a link's href) or add a new element inside it (for example a new list item). The result is the whole HTML, changed.

Add the action

In the Process Designer toolbox, open HTML and pick HTML Manipulation (or type HTML Manipulation in the search box).

The HTML Manipulation action properties: HTML Input, XPath Expression, HTML Attribute, New Value and HTML Output

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
HTML InputInputTextNoThe HTML to change.
XPath ExpressionInputTextYesSelects the element to change, or the parent element to add a new element to, for example //a or //ul[@id="menu"].
HTML AttributeInputTextYesThe attribute to set, for example href. Leave it empty to add a new element instead.
New ValueInputTextYesThe attribute's value, or, when HTML Attribute is empty, the full HTML of the element to add.
HTML OutputOutputTextYesThe changed HTML.

Example

HTML InputXPath ExpressionHTML AttributeNew ValueHTML Output
<div><a href="old.html">Link</a></div>//ahrefhttps://example.com<div><a href="https://example.com">Link</a></div>
<ul id="menu"><li>Home</li></ul>//ul[@id="menu"](empty)<li>Contact</li><ul id="menu"><li>Home</li><li>Contact</li></ul>
<div></div>//tableclassxThe step fails: The provided XPath expression did not match any nodes in the HTML document.

Good to know

  • Only the first element the XPath matches is changed. To change a specific one, make the XPath precise (//a[@id="home"], (//a)[2]).
  • Setting an attribute that does not exist yet adds it; setting one that exists replaces its value.
  • A new element is added as the last child of the selected element.
  • HTML Attribute is marked as required in the panel, but it must be left empty to add an element.
  • An empty HTML Input fails the step with HTML input is null.

On this page