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.
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.
Input | Type | Description |
types | Array | Optional array of object types that determines which types of objects your users can pick. Possible values for object types include: If For example, if |
allowMultiSelect | Boolean | Optional boolean field that allows your users to select multiple objects in one File Picker session. The default value is |
onSubmit | Function | Callback that returns an array of See an example for |
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
object is used to represent a file in the workspace. The Object typically exists under a folder or drive, if it exists.id
UUIDremote_id
Stringcreated_at
DateTime (ISO 8601)modified_at
DateTime (ISO 8601)name
Stringfile_url
Stringfile_thumbnail_url
Stringsize
Integermime_type
Stringdescription
Stringfolder
UUIDpermissions
Permission[]id
UUIDremote_id
Stringcreated_at
DateTime (ISO 8601)modified_at
DateTime (ISO 8601)user
UUIDgroup
UUIDtype
EnumUSER
, 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.roles
ArrayREAD
, WRITE
, OWNER
. In cases where there is no clear mapping, the original value passed through will be returned.drive
UUIDremote_created_at
DateTime (ISO 8601)remote_updated_at
DateTime (ISO 8601)remote_was_deleted
Booleanfield_mappings
Objectremote_data
Array