The Evaluate XPath feature in the Data Preview tool provides an advanced way to test and troubleshoot the logic of your forms during development. This functionality allows you to write XPath expressions and instantly see how they evaluate against the current state of your form data. This is particularly useful for validating calculations, conditional logic and data constraints before finalizing your form.
Real-time Evaluation
Evaluate XPath expressions dynamically as you interact with the form. This helps in checking how the logic responds to changes in the form's data during entry.
Data Exploration
Query specific nodes or values in the XML structure of the form using XPath. This is valuable for debugging complex logic involving hidden fields, repeat groups, or nested data.
Error Identification
Test conditions or expressions to identify errors or unexpected behavior in your form's logic, such as:
/data/... syntax to reference fields in your form. For example:
/data/field_name/data/field1 + /data/field2/data/repeat_group[position()=1]/field_name/data/... syntax for field references, as opposed to #form/..., to ensure compatibility with the XML structure.if() or selected(), to confirm their accuracy.position() to target specific entries in a repeat group.The Evaluate XPath feature is a powerful addition for developers and advanced users, simplifying debugging and ensuring forms are logically sound before deployment. If you're new to XPath, start with simple expressions and gradually explore more complex queries to fully leverage this tool.
concat(*arg)