In addition to the standard numeric and alpha
data types, dictionary items can wrap the following
CSPro objects that contain binary data:
These binary data types are only available if the dictionary option
Enable Binary Items (experimental) has been checked. Once enabled, you cannot disable the option unless all binary dictionary items have been removed from your dictionary.
Binary dictionary items can only be used when using the following
data sources:
CSPro DB,
Encrypted CSPro DB,
JSON,
None, and
In-Memory. When using a data source that does not support binary data, such as
Text, you will get a runtime error when attempting to run an application that contains binary dictionary items.
Binary dictionary items are
synchronized as part of a call to
syncdata. If binary data has already been uploaded to a synchronization server, the data will not be uploaded again. However, it is still a good idea to be aware of the size of the binary data that you synchronize, as syncing these cases can slow down syncing activities significantly.
As of CSPro 8.0, binary dictionary items cannot be added to forms. Instead, you will need to write logic within your application that references these items in order to manipulate them. The functions available with the
Audio,
Document,
Geometry, and
Image objects can be used on the binary dictionary items when valid (an occurrence of the parent record exists). For example:
PROC ROOF_TYPE
if accept("Do you want to take a photo of the roof?", "Yes", "No") = 1 then
// take a photo, storing the image in the binary dictionary item ROOF_IMAGE
if ROOF_IMAGE.takePhoto() then
// because these images will be synced, ensure that the photo is not too large
ROOF_IMAGE.resample(maxWidth := 1200, maxHeight := 800);
endif;
endif;
While binary dictionary items are experimental, they cannot be used within the
Export Data and
Tabulate Frequencies tools. You will note that binary dictionary items do not appear in the tree. However, the rest of CSPro's
tools work with binary data.
Data Viewer: When viewing a case within Data Viewer, if any binary dictionary items exist in the case, they will displayed within the field. If an image has been stored, a preview of that image appears. If it is an audio clip, you have the option to play it within Data Viewer. For all binary data types you have the option to open the file (in read-only mode) or save to a new file by clicking on the thumbnail or choosing the
Open and
Save options listed beneath each file.
Compare Data: When a binary dictionary item is chosen for comparison, the size of the file associated with that item is compared, regardless of the file name or file type. If the file sizes are the same, then the contents will be compared.
Reformat Data: Reformating binary dictionary items is possible in a few scenarios:
Input | Output | Outcome |
Alpha | Binary Dictionary Item | Fails |
Binary Dictionary Item | Alpha | Fails |
Binary Dictionary Item | Audio | Succeeds if the MIME type is a valid audio type |
Binary Dictionary Item | Document | Succeeds |
Binary Dictionary Item | Geometry | Succeeds if the MIME type is GeoJSON |
Binary Dictionary Item | Image | Succeeds if the MIME type is a valid image type |
Binary Dictionary Item | Numeric | Fails |
Numeric | Binary Dictionary Item | Fails |
Sort Data: If a binary dictionary item is chosen as the sort key, the size of the file associated with the binary dictionary item is used as the sort value.