Callback
The Osmos Uploader provides a callback to the host page when the Osmos Uploader window closes. The callback is made to the function mapped to the completionHandler key. This key is optional. If a handler function is assigned, it will called providing:
  1. 1.
    originalFileUrl: URL of original uploaded file. The file will be available at this for the data retention duration configured on your Osmos account, after which the URL will return 404. In order to to avoid name collisions, the filename will be appended with GUID values.
  2. 2.
    reachedTransformStep: Boolean indicating if the user successfully reached the transformation step
  3. 3.
    successfullySubmittedData: Boolean if the user successfully submitted data and completed the upload experience
  4. 4.
    numRecordsSubmitted: Number of records submitted
  5. 5.
    skippedRowNumbers: Array of row numbers that were skipped, starting at data row number 0, and not including the header row in the count.
Here’s an example of a code snippet for completionHandler callback
1
FortyTwoLayers.configure({
2
userID: window.curUserID,
3
completionHandler: async (params)=> {
4
console.log(params)
5
},
6
schema: {
7
fields: [
8
{
9
name: 'field1',
10
displayName: 'Field 1',
11
},
12
...
13
],
14
},
15
...
16
}
Copied!
1
type params = {
2
originalFileUrl: string,
3
reachedTransformStep: boolean,
4
successfullySubmittedData: boolean,
5
numRecordsSubmitted: number,
6
skippedRowNumbers: Array
7
}
Copied!
Copy link