Validation on Shared Interviews – XpressDox

This article addresses different types of validation on shared interviews; both the ValidateBeforeShare command, and the use of the XD_isSharedInterviewMode data element.

 

ValidateBeforeShare command

When sharing interviews you might have a need for certain fields to be completed by the sender before the interview is allowed to be sent. That is achieved with the ValidateBeforeShare command. However you might like to take it a step further and present only certain parts of the interview to the sender, and certain parts to the recipient.

 

XD_isSharedInterviewMode data element

When an interview has been shared, a data element called XD_isSharedInterviewMode is added to the dataset. It is absent from the dataset whilst the sender is completing their portion of the interview, and present in the dataset when the recipient is completing their portion. This data element can be tested with document logic. Consider this example:

«if(isFalse(XD_isSharedInterviewMode))»
To be completed by sender:
«Item1», «Item2», «Item3»
«End()»

«if(isTrue(XD_isSharedInterviewMode))»
To be completed by recipient:
«Item4», «Item5», «Item6»
«End()»

The first part of that snippet is what will be seen by the sender i.e. if the data element does not exist, and the second part is what will be seen by the recipient.

 

Using Required()

Using the Required command to validate fields is fine if you want the fields that the recipient is completing to be mandatory. The Required command is only executed when the document is assembled, which only happens when the recipient of the interview presses Assemble. If you want to force senders to complete a field then it is preferable to use ValidateBeforeShare.