Description:
This step fetches a value by using the XPath expression.
Inputs
- xmlVariable - variable that holds the xml
- xPathExpression - xpath expression to use
- attributeName – name of the attribute
- variableToStoreValue - variable to store the value
- isExpression - evaluate xpath function
Returns
- True – True condition
- False – False condition
Usage:

Example:
Let’s build and execute the “getXPathValueDef” example.
- Create a new process definition called “getXPathValueDef” and open the definition in designer mode.
- Drag “updateVariables, getXPathValue” step to the canvas.
- Connect the dots between the “Start” step and other steps, as shown above.
- Define a variable or a global to store the XML value and result.
- Click the "updateVariables" step to configure its "Required" properties. Provide a name for the step. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- Click the "updateVariables" step to configure its "Optional" properties. Provide a variable or global to store the XML value. Provide the XML value. Configure “Yes” if the value has an expression to evaluate. Click the Save button. Click the button to provide multiple variables. A pop-up window is displayed for configuration. Click the Add Row button to insert an empty row. Provide the variable name and value. Click the Save button. You may add multiple variables using the Add Row button.

- The XML used in the example is included below.
<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="web">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
- The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

- Click the "getXPathValue" step to configure its "Required" properties. Provide a name for the step. Provide a variable or global reference that holds the XML value. Provide the XPath expression to use. Provide a variable or global reference to store the value. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- Click the "getXPathValue" step to configure its "Optional" properties. Select "Yes" to evaluate the XPath function. Provide the name of the attribute. Click the Save button.

- The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

- Save the process definition, create a new instance, and then execute it. Render the process instance. Click the process step. The step should get the value from XPath. Click on the “getXPathValue” step to view the variables or properties information.

- Some XPath expressions and their results (for reference).
xPath expression | Result |
//bookstore/book[1] | Selects the first book item that is a child of the bookstore item |
//bookstore/book[last()] | Selects the last book item that is a child of the bookstore item |
//bookstore/book[last()-1] | Selects the second-to-last book item that is a child of the bookstore item |
//bookstore/book[position()<3] | Selects the first two book items that are children of the bookstore item |
//title[@lang] | Selects all the title elements that have an attribute named “lang” |
//title[@lang='en'] | Selects all the title elements that have a "lang" attribute with a value of "en" |
//bookstore/book[price>35.00] | Selects all the book elements of the bookstore element that have a price element with a value greater than 35.00 |
//bookstore/book[price>35.00]/title | Selects all the title elements of the book elements of the bookstore element that have a price element with a value greater than 35.00 |
Definition Sample:
You may download the sample definition(s) from the link here and later import them (drag-and-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.
Note: Please verify and complete the process steps for any missing configurations, such as file path references and database connections, after import. Then, save the definition to confirm the changes.