getXPathValue Step

Use this feature to retrieve a value from XML using an XPath expression and store the result in a FlowWright Variable or Global variable.

Last published at: September 15th, 2026

Description:

The Get XPath Value workflow step evaluates an XPath expression against XML stored in a Variable or Global variable and stores the result in another Variable or Global variable.

The step supports:

  • Reading XML from a FlowWright Variable or Global variable.
  • Specifying an XPath expression to locate a value.
  • Optionally evaluating an XPath function.
  • Retrieving an attribute value by specifying an attribute name.
  • Storing the retrieved value in a Variable or Global variable.
  • Reusing the extracted value in subsequent workflow steps.
  • XML value extraction within workflow automation.
  • Returning a True or False result for subsequent workflow processing.

 

Inputs

  • xmlVariable - The Variable/Global that holds the XML property specifies the FlowWright Variable or Global variable containing the XML to be processed.
  • Evaluate xpath function - The Evaluate XPath function property specifies whether XPath function evaluation should be enabled.
  • XPath expression to use – The XPath expression to use property specifies the XPath expression used to locate the value within the supplied XML.
  • Name of the attribute - The Name of the attribute property specifies the name of an XML attribute when the workflow needs to retrieve an attribute value.
  • Variable/Global to store the value - The Variable/Global to store the value property specifies the FlowWright Variable or Global variable in which the value retrieved by the XPath operation is stored.
 

 

Returns

  • True – The True return path can be connected to the next workflow activity when the XPath value operation produces the expected workflow outcome.
  • False – The False return path can be used for error handling or an alternative workflow path.
 

 

Usage:

The Get XPath Value step is typically placed after another workflow activity collects, generates, retrieves, or returns XML.

The XML is supplied through a Variable or Global variable. An XPath expression then identifies the required value, and the result is stored in another Variable or Global variable.

A typical workflow pattern is:

Get/Build XML → Get XPath Value → Use Result

The resulting value can then be used by later workflow steps to:

  • Populate Variables.
  • Make workflow decisions.
  • Build messages.
  • Generate notifications.
  • Prepare integration data.
  • Process XML responses.
  • Extract XML attributes.
  • Populate form or business data.
  • Create workflow output.
  • Pass extracted values to another activity.

This follows the same intermediate-processing pattern used in the Search Replace String documentation, where one activity prepares data, the target step processes it, and subsequent workflow activities receive it.

A typical workflow can be structured as:

 

Typical Workflow Suggestions:

Extract a Value from XML

Use the step to retrieve a specific value from XML received by the workflow.

Example:

Retrieve XML → Get XPath Value → Process Retrieved Value

For example, if the XML contains customer information, you can configure an XPath expression to locate the required customer value.

The resulting value is stored in the configured Variable or Global variable.

 

Extract an Attribute Value

Use the optional attribute name when the required value is an XML attribute.

Example:

Retrieve XML → Get XPath Value → Process Attribute

For example:

<Customer id="CUST-1045">
    <Name>Acme Corporation</Name> </Customer>
A workflow can use an XPath expression to identify the correct XML location and specify the attribute name when it needs the attribute value.

Test the exact XPath expression and attribute-handling behavior against the XML structure used by the workflow.

 

Process an XML Response

Use the step after a workflow activity retrieves an XML response from an external system.

Example:

Call Service → Store XML Response → Get XPath Value → Process Response

The workflow can extract a required value from the response before continuing with additional processing.

This is useful when a downstream activity requires a single value rather than the complete XML response.

 

Extract Multiple Values

Use multiple Get XPath Value steps when you need several values from the same XML document.

Example:

Retrieve XML
    |
    +--> Get XPath Value → Store Customer ID
    |
    +--> Get XPath Value → Store Customer Name
    |
    +--> Get XPath Value → Store Customer Status
Each step can use a different XPath expression and store its result in a separate Variable or Global variable.

 

Extract Data Before a Workflow Decision

Use an extracted XML value as input to subsequent workflow logic.

Example:

Retrieve XML → Get XPath Value → Decision/Condition

For example, a workflow can extract a status value from an XML response and use that value in subsequent workflow processing.

This keeps the XML parsing activity separate from the decision-making logic.

 

Extract a Status Value

Use the step to retrieve a status or state value from an XML document.

Example:

Receive XML → Get XPath Value → Evaluate Status → Continue/Handle Status

Later workflow activities can then use a status retrieved from XML to determine what processing should occur.

 

Extract an Identifier

Use the step to retrieve an identifier from XML before performing additional processing.

Example:

Retrieve XML → Get XPath Value → Store Identifier → Retrieve Related Data

This pattern can be useful when an XML response contains an identifier required by a subsequent database, form, business-object, or integration activity.

 

Extract Values from Form-Generated XML

Use XML generated or assembled during workflow processing as the input to the step.

Example:

Collect Form/Data → Build XML → Get XPath Value → Process Value

This lets you extract a specific value from a larger XML structure without passing the complete XML document to every downstream activity.

 

Prepare Data for an Integration

Use the step to extract a specific value from an XML document before passing it to another integration activity.

Example:

Retrieve XML → Get XPath Value → External Integration

You can store the extracted value in a Variable or Global variable and supply it to the integration step.

 

Extract Values from XML Documents

Use the step when an XML document contains structured information that needs to be converted into individual workflow values.

Example:

Read XML → Get XPath Value → Store Values → Process Document

This can be useful for workflows that process XML files or XML content generated by another system.

 

Evaluate an XPath Function

Use the Evaluate XPath function option when the workflow requires XPath function evaluation.

Example:

Retrieve XML → Configure XPath Function → Get XPath Value → Use Result

The XML definition confirms that this option exists, but does not specify the complete list of supported XPath functions.

Test the intended expression and function in the target environment before deploying the workflow.

 

Store an Extracted Value for Reuse

You can store the extracted value in a Variable or Global variable and reuse it in several subsequent workflow activities.

Example:

Get XPath Value → Store Result → Multiple Subsequent Steps

For example:

Get XPath Value
      |
      v
Variable/Global
   /    |    \
  v     v     v
Email  Form  Integration
This keeps the XML extraction operation in one place while allowing multiple activities to use the resulting value.

 

Handle an Unsuccessful Extraction

Use the False return path to provide an alternative workflow path when the expected operation does not produce the required result.

Example:

Get XPath Value
    /       \
 True       False
  |           |
Continue    Log/Notify
Confirm the precise conditions that trigger the False path through workflow testing because they are not defined in the XML.
 

Example:

Let’s build and execute the “getXPathValueDef” example.          

  • Create a new process definition named “getXPathValueDef” and open it in designer mode. 
  • Drag the “updateVariables, getXPathValue” step to the canvas. 
  • Connect the dots between the “Start” step and other steps, as shown above. 
  • Select the line between the steps to configure the “Connection Properties”. The default property values are “None, True, False, Error, and Evaluate”. Depending on the step’s purpose, you can configure additional values.
  • 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, then click Save. Note: Click the "AI Predict" button to have the Copilot 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. Enter the XML value. Set to “Yes” if the value includes an expression to evaluate. Click the Save button. Click the button to add multiple variables. A pop-up window appears for configuration. Click the Add Row button to insert an empty row. Enter 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 provided 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” configuration is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure “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 to have the Copilot 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. Enter the attribute name. Click the Save button. 

 

  • The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. Configure 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 execute it. Render the process instance and click the process step to view its properties. When the workflow reaches the Get XPath Value step, FlowWright processes the XML held in the configured Variable or Global using the supplied XPath configuration. The resulting value is stored in the specified Variable or Global variable. Verify the stored value and confirm that the workflow follows the expected True or False path. The Search Replace String reference uses the same process of saving the definition, creating and executing an instance, rendering the instance, and inspecting the step during execution.

 

  • 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

 

Tips:

  • Make sure the Variable or Global containing the XML is populated before the step executes.
  • Verify that the XML supplied to the step has the expected structure.
  • Use an XPath expression that corresponds to the actual XML structure.
  • Test XPath expressions with representative XML before deploying the workflow.
  • Use a meaningful Variable or Global name for the extracted result.
  • When extracting multiple values, store each result in a clearly named Variable or Global.
  • Use the optional attribute property only when an attribute value is required.
  • Verify the attribute name against the actual XML structure.
  • Test expressions against XML containing realistic values.
  • Test XML with missing or optional elements where applicable.
  • Consider connecting the False return path to appropriate error handling.
  • Verify the extracted Variable or Global value before using it in downstream activities.
  • Keep XPath expressions maintainable when the XML structure changes.
  • Test the workflow after modifying the XML structure or XPath expressions.
  • When using dynamically generated XML, verify that the generated XML matches the expected structure before executing the XPath step.
  • If XPath function evaluation is enabled, test the intended XPath function in the target FlowWright environment.
  • Do not assume that every XPath function or XPath syntax variation is supported unless confirmed by the FlowWright implementation.
  • Do not assume the exact behavior for an unmatched XPath expression, malformed XML, or missing attribute without testing it.
  • Keep sensitive XML values out of workflow logs when the XML contains confidential information.
  • If you process the same XML structure repeatedly, use consistent XPath conventions across workflows.

 

Notes:

  • The Get XPath Value step is defined in the Decisions category with the internal name getxpathvalue, label Get a value from using xpath expression, and display name Value Xpath Expression.
  • The step is implemented by FlowWright.Workflow.GetXPathValue in FlowWright.Workflow.dll and is defined as a Process step with 2 incoming connections and 2 outgoing connections.
  • The step defines five properties:
    • xmlVariable – Variable/Global that holds the XML
    • isexpression – Evaluate XPath function
    • xPathExpression – XPath expression to use
    • attributeName – Name of the attribute
    • variableToStoreValue – Variable/Global to store the value
  • Three properties are required:
    • xmlVariable
    • xPathExpression
    • variableToStoreValue
  • Two properties are optional:
    • isexpression
    • attributeName
  • The xmlVariable, xPathExpression, attributeName, and variableToStoreValue properties use the string data type, implemented by FlowWright.DataTypes.ClsTextBox. The isexpression property uses the selectYesNo data type, implemented by FlowWright.DataTypes.ClsYesNo.
  • The step provides two return values:
    • False
    • True

 

Definition Sample:

You may download the sample definition(s) from the link provided and later import them into your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

Note: Verify and complete any missing configuration after importing the sample, including:

  • XML Variable or Global variable.
  • XPath expression.
  • Evaluate XPath function setting, if required.
  • Attribute name, if applicable.
  • Variable or Global variable used to store the extracted value.
  • Workflow Variable references.
  • Environment-specific settings.
  • Downstream True and False workflow paths.

After verifying the configuration, save the Process Definition before execution.

Click here to download the sample file.