Accessing The Current Validation Step
When building a workflow process in GlobalCapture that involves a GlobalForms import, it is helpful to know what validation step a form is in at any given point in time. If for example you are building a PO approval process, you may choose to show different form components based on the current state. New PO's may show the basic data entry form components, while forms in a validation node named "Approval" might add a Signature component to the form so an Approver can apply a wet signature with the mouse, stylus, or a Topaz signature tablet.
Access submission.metadata.Node from any Javascript rule to identify the current validation node as detailed in the example below.
It is recommended that you use a Calculated Value Rule (found on the Data tab) of a hidden Text Component to store this value. You can then use Simple Conditionals to show or hide components based on that value. Always remember to make sure Clear Values When Hidden when showing and hiding controls. If this option is checked, any data elements in the control will be cleared when visibility changes.
Note - If the form doesn't exist it in a Validation Step on opening it (like when creating a new submission, it will present a javascript error). The rule below outlines how to properly execute the rule, and default a value if the form is not in a validation node.
try { if (submission.metadata.Node) { value = submission.metadata.Node; } else if (!submission.metadata.Node) { //Default value to set if not in validation node value = 'Submitted Form'; } } catch(err) { //Default value to set if not in validation node value = 'Submitted Form'; }