Skip to main content

Data fields

To include data from the library's internal state or status in the HTML content, the data-dw-data attribute is used. Elements with this tag will have their content substituted with the value specified.

info

There may be a momentarily delay before the value is substituted, so a suitable placeholder should be included in the HTML. The entire content of the element is replaced.

Example using data attribute
<span data-dw-data="source.manipulating">[Loading]</span>

Attribute selectors can be used to customise the content shown based on the status of the library. The example below pins the interface to the bottom of the screen on mobile devices once one or more data sources have been added.

Example using attribute selectors
@media only screen and (max-width: 800px) {
[data-dw-source-count]:not([data-dw-source-count='0']) .dw-controller-inline {
position: fixed !important;
width: 100vw !important;
left: 0 !important;
bottom: 0 !important;
}
}

Options

The data described in the table below can be used both as an output option, by setting the data-dw-data attribute on an element, or as an attribute selector within stylesheets.

info

All HTML associated with the library is injected within a single element with the ID datawollet-root. This element has the data attributes listed below.

Some of the values would not ordinarily be used as output data and exposed to the user, but are shown for completeness.

data-dw-data valueParent data attributeDescription
interfacedata-dw-interfaceWhether the inline interface for the library is expanded or collapsed.
activitydata-dw-activityThe overall activity status, which is idle, prefilling, filling or uploading.
interactiondata-dw-interactionWhether the user is being asked to interact with the interface, either none or confirming.
capability.scandata-dw-capability-scanWhether the scan capability is available based on the device and browser data known. This may change after attempting to initialise a scan.
source.countdata-dw-source-countThe total number of sources added.
source.errordata-dw-source-errorThe error associated with a source, if any, as described in the table below.
source.manipulatingdata-dw-source-manipulatingThe file name of a source being manipulated, used when confirming the removal of a source through interaction.
fill.expecteddata-dw-fill-expectedThe total number of auto-filled fields expected. This number may not be exact as some auto-fills cannot be precalculated, when they depend on the options available.
drop.activedata-dw-drop-activeWhether a file is being dragged over the drop area.
drop.permitteddata-dw-drop-permittedWhether the file being dragged over the drop area is allowed, and would be uploaded if dropped.

Possible values for source error

source.errorDescription
file-typeSource is not of the correct type (e.g. PDF). This error is uncommon as the file picker and drop zone both check file types before accepting input.
file-parseSource could not be read (e.g. corrupt).
file-sizeSource is too large (~4.5MB limit per request).
source-unexpectedSource was classified as a data source that isn't listed as an expected type (e.g. bill provided when identity document expected).
source-unmatchedSource document type could not be determined (not in library).
source-lackingSource was processed successfully but no data was extracted.
server-errorServer returned an error not otherwise described. Retrying could be recommended.
server-timeoutServer did not respond within the configured timeout. Document could be too large or the internet connection poor.
server-forbiddenServer submission was blocked or rejected. Could be a result of network restrictions or browser restrictions.
scan-capabilityScanning capability is not an option with the browser or hardware available.
scan-permissionPermissions required were not granted by the user, such as access to the camera.
scan-qualityScan seems to be of poor quality and might not be able to be used. Retrying could be recommended with further guidance.