Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...


Summary

The CloudCare instance viewer Data Preview is a (currently feature flagged) tool that will allow you to view the current state of the instance XML your form data as you perform form entry. You can view either the XML structure itself with values filled in, or the questions in a pretty UI. Further you can enter XPath's to see how they evaluate against the current XML structure.

Activation

You can activate this feature via the Feature Flag UI under the Admin tab.

Important: If you are testing with a mobile worker you must enter the email of the mobile worker into the feature flag. Email will be: username@project-space-name.commcarehq.org.

Image Removed

Questions

Form entry is performed as usual

Image Removed

Question Viewer

You can view a list of the current questions and the current responses. This is useful for complex calculations in hidden values, obviating the need for debug labels. 

Image Removed

XML Viewer

The XML viewer shows the same information as above, but also allows you to see the current tree structure. This can be useful for debugging complex XPath traversals. 

Image Removed

XPath Evaluator

This dialog allows you to entry plain text XPath that are evaluated against the current instance. 

Image Removed

Next Steps

In addition to the usual feedback on bugs and UI suggestions, we're interested in feedback from the field team and other power users about what enhancements or extensions would be useful for the next iteration of this feature. This is a feature that could evolve in many ways and we want to be directed about how we invest in this feature. Possible next steps are:

  1. Ability to inspect external instances (IE casedb, fixtures, ledgerdb, etc.)
  2. Click on XML, get XPath
  3. Perform calculations on XPaths

 

Please email Will (wpride@dimagi.com) with any feedback. Thanks!Basic Usage

Form entry is performed as usual and you will notice a bar at the bottom of the page that says Data Preview.

Info
titlePermissions

This feature is only available to users with edit_data permissions.

 

Image Added

To open data preview, simply click the dark blue bar at the bottom to open it. Below you'll see a screen with the form data shown. This is useful for figuring out calculations on hidden values.

Image Added

The debugger is also available in live preview

Image Added

Advanced Usage

In most scenarios, viewing just the form data is enough to get insight on your application. However, Data Preview also offers the ability to query your data as well as view the raw xml of the form.

Evaluate XPath

 

Form XML