File Picker

Merge's File Picker is built into our embedded Merge Link component and provides a user-friendly interface for your customers to browse Files, Folders, and/or Drives in their connected File Storage account. File Picker does not impact your File Storage Linked Account syncs.


Demo Video
Watch this quick video to learn the basics of how Merge's File Picker works.
...Loading

Setting up Merge Link with File Picker

To set up File Picker, please follow our Embedded Link guide to add our drop-in Merge Link component to our app.

Make sure you have the latest version of react-merge-link.

Enabling the File Picker only requires a few additions to step 2.

In addition to following step 2 of our Embedded Link guide, you will need to add a new parameter filePickerConfig.

onSubmit is the only required input to filePickerConfig, and returns an array of selected objects from your user's workspace.

This input is a callback and is left as console.log() in this example for you to decide how to handle Files, Folders, and Drives that your users have selected in the File Picker. If you are testing the File Picker in your dashboard, no callback is provided and the File Picker will automatically close on submit.

In this example, the File Picker configuration allows multi-select of Files and Folders.

See details about each filePickerConfig input below.


Configuration Inputs
InputTypeDescription
typesArray

Optional array of object types that determines which types of objects your users can pick.

Possible values for object types include: FILE, FOLDER, DRIVE.

If types is empty, your users will be able to pick objects of any type. If types is not empty, your users are restricted to selecting from the object types in the array.

For example, if types = ['FILE', 'FOLDER'], your users will be able to select Files and Folders, but not Drives.

allowMultiSelectBoolean

Optional boolean field that allows your users to select multiple objects in one File Picker session.

The default value is false, which restricts your users to only select one object.

onSubmitFunction

Callback that returns an array of MergeFileStorageData objects as its output.

See an example for MergeFileStorageData below.


Merge File Storage Data

MergeFileStorageData properties should match our File Storage Common Model properties for the given workspace object type.

Select the object type to see its corresponding properties and example response.

FILE

FOLDER

DRIVE

The File object is used to represent a file in the workspace. The Object typically exists under a folder or drive, if it exists.
Properties

idUUID
Required

remote_idString
Optional
The third-party API ID of the matching object.

created_atDateTime (ISO 8601)
Required
The datetime that this object was created by Merge.

modified_atDateTime (ISO 8601)
Required
The datetime that this object was modified by Merge.

nameString
Optional
The file's name.

file_urlString
Optional
The URL to access the file.

file_thumbnail_urlString
Optional
The URL that produces a thumbnail preview of the file. Typically an image.

sizeInteger
Optional
The file's size, in bytes.

mime_typeString
Optional
The file's mime type.

descriptionString
Optional
The file's description.

folderUUID
Optional
The folder that the file belongs to.

permissionsPermission[]
Required
The Permission object
The Permission object is used to represent a user's or group's access to a File or Folder. Permissions are unexpanded by default.
Properties

idUUID
Required

remote_idString
Optional
The third-party API ID of the matching object.

created_atDateTime (ISO 8601)
Required
The datetime that this object was created by Merge.

modified_atDateTime (ISO 8601)
Required
The datetime that this object was modified by Merge.

userUUID
Optional
The user that is granted this permission. This will only be populated if the type is USER.

groupUUID
Optional
The group that is granted this permission. This will only be populated if the type is GROUP.

typeEnum
Optional
Denotes what type of people have access to the file. Possible values include: USER, GROUP, COMPANY, ANYONE. In cases where there is no clear mapping, the original value passed through will be returned. To receive all enum values in the original format, use the show_enum_origins query parameter. Learn more.

rolesArray
Optional
The permissions that the user or group has for the File or Folder. It is possible for a user or group to have multiple roles, such as viewing & uploading. Possible values include: READ, WRITE, OWNER. In cases where there is no clear mapping, the original value passed through will be returned.

driveUUID
Optional
The drive that the file belongs to.

remote_created_atDateTime (ISO 8601)
Optional
When the third party's file was created.

remote_updated_atDateTime (ISO 8601)
Optional
When the third party's file was updated.

remote_was_deletedBoolean
Required
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more.

field_mappingsObject
Optional

remote_dataArray
Optional