Index
Video Courses
Watch structured video courses
Knowledge Base
Visit our User Forum for discussions & solutions
Saving XML Data to a BLOB
There are scenarios where you may want to save XpressDox interview data as an XML dataset into a BLOB. For example, to store matter-specific data against a matter record in your practice management system, and to retrieve it again the next time that matter is opened in an interview.
Database Table Structure
Your database table needs to include at minimum:
- A column for the matter identifier (e.g. MatterNumber or MatterID; use whatever corresponds to your matter data element)
- A BLOB column to store the XML dataset (e.g. Data)

What Goes in the Config
When configuring your data source in XpressDox:
- Set the user selection to all rows
- At the bottom of the configuration screen, select the “Data” field name as the column which contains an XML dataset

This tells XpressDox to treat that column as an XML dataset rather than a plain text value, so that when it is retrieved, the data elements are correctly placed into the template’s dataset hierarchy.
What Goes in the Template
Pulling data into the interview
To retrieve data from the database when the user enters a matter number, use LinkToDataSourceOnEnter:
«Comment(pull data by entering in an existing matter number)»
«LinkToDataSourceOnEnter(MatterNumber,MatterBLOB,Refresh,id=<MatterNumber>)»
Note: LinkToDataSourceOnEnter fires when the user enters the field, so data is retrieved as soon as the matter number is typed — without requiring the user to tab out. If you use LinkToDataSource instead, it fires on exit and the user must tab out of the MatterNumber field to trigger the lookup.
Saving data to the database on assembly
To save the completed dataset back to the database when the document is assembled, use SetDataSourceData together with GetDataSet():
«Comment(save data to data source on assembly)»
«SetDataSourceData('MatterBLOB',MatterNumber,'Data',GetDataSet())»
This writes the entire current XML dataset into the Data column of the MatterBLOB data source, keyed on the MatterNumber.
Saving Interim Data Mid-Interview
It is also possible to save data to the database at any point during the interview and not just on final assembly. This is achieved by linking a Button to a SetDataSourceData call via OnExitSet.
«Comment(save data to data source on the click of a button mid-interview)»
«Button(SaveData)»
«Caption(SaveData,Save current data)»
«OnExitSet(SaveData,Value,Value,(),SetDataSourceData('MatterBLOB',MatterNumber,'Data',GetDataSet()),,EvenWhenNotEmpty)»
Note: This is different from clicking Save Data in the Data options on the XpressDox Explorer, which saves a dataset to the Cloud. The button approach below saves interim data directly to the database. When the user clicks the Save current data button during the interview, the current state of the dataset is written to the database immediately.