Versions Compared

Key

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

For any forms in the Hire to Retire package, the application will pass the current Validation Node name as a query string parameter in the url.  This will take the form of node=ValidationNodeName.  For example, the stock Form I-9 only shows the Employer section of the form when the onboarding package is in a Validation Node name Waiting HR.  Some GlobalForms administrators might be more familiar with controlling form state based on the Javascript submission.metadata variable outlined here.  While this variable may be applicable if you have a GlobalCapture workflow defined to pick up the individual resource forms directly, the Hire to Retire package is based on the capture processing of the HR Onboarding landing page form.  Hire to Retire is configured to pass the corresponding Validation Node to all of the forms in the package automatically.

To access the query string parameters, add a Text Component to your form.  On the Data tab, add a Calculated Value rule that stores the node value from the query string.  Accessing query string parameters is documented here.  Depending on your use case, you work with both methods of accessing the current Validation Node.  The script below will set a Text Component's value to the node parameter passed in the query string if one is available.  If no node value is found, it will attempt to use the submission value directly.  Lastly, it will set the value to an empty string.


Code Block
languagejs
var params = new URLSearchParams(window.location.hash.split('?')[1]);
if(params.get('node'))
{
    value = params.get('node');
}
else if(submission && submission.metadata)
{
    value = submission.metadata.Node;
}
else
    value = '';