Optional Uploader Settings
There are a number of additional options that can be modified in the initial osmos.configure
function call to customize the uploader further. Below is a configured sample Osmos Uploader with a single field:
Adding Uploader Description text: uploadDescription:
A standard output of the HTML snippet which must be configured. This function shows a description of the Uploader to a user.
The description will also appear on the column mapping.
Show/Hide Upload Description: hideUploadDescription:
A standard output of the HTML snippet which defaults to true
. This function determines whether to show the destination description when the user is uploading their file.
Show/Hide Upload Schema:hideUploadSchema:
A standard output of the HTML snippet which defaults to true
. This function will be called when the user closes the Uploader. It will be called with the following arguments:
originalFileUrl
- string | undefined, the URL the submitted file was uploaded to or undefined if they closed the uploader before submittingreachedTransformStep
- boolean, whether the user reached the transform stepsuccessfullySubmittedData
- boolean, whether the user's data was successfully submitted or notnumRecordsSubmitted
- number, the number of records submittedskippedRowNumbers
- number[], the indices of rows from the original file that were manually skipped by the user
Turn On/Off Advanced Mode Uploader: disableAdvancedMode:
Disables Advanced Mode. true
by default.
Changing how many rows of data to show in the Uploader: maxRecords:
Not a standard output of the HTML snippet. This function defines the maximum amount of records or rows to display and validate. This defaults to 100_000
. This also limits the amount of records that will be sent to validation webhooks. Setting a lower limit can be useful if your users are encountering performance issues when uploading large files or if your validation webhooks fail with large payloads.
Turn On/Off PreviewPane when Uploading CSV Files: hideCSVPreviewPane:
A standard output of the HTML snippet which defaults to false
. This function determines whether to show the preview pane when the user is uploading a CSV File.
Turn On/Off Callback: completionHandler:
Not a standard output of the HTML snippet. This function determines whether to show an "upload complete" Callback when the user upload has been completed.
Enabling/Disabling Recall + Auto-Mapping: After loading, the uploader attempts to automatically map fields and apply some transforms based on heuristics and previously seen files. While this behavior is usually useful to speed up mapping and ease the upload process, there some scenarios where it is undesired.
Set
autoMapEnabled
tofalse
to disable automatic field mapping based on heuristicsSet
autoRecallEnabled
tofalse
to disable automatic population of transforms based on previous uploads
Enabling Submission with Errors: In some cases, it can be beneficial to allow submitting uploads even if there are errors. To enable this, set the allowSubmissionWithErrors
option to true
.
Disabling Transform Recall Storage: By default, Osmos stores all data transformations (mappings, formulas, QuickFixes, etc.) submitted to uploaders for recall. Recall is the process by which transforms are auto-populated when the uploader is first opened during subsequent uploads.
If you want to disable this functionality and prevent the transforms for uploads to be saved for recall, you can set the storeTransformsForRecall
option to false
.
For more information on Callback functionality, please see Notifications: Callback
Last updated