Skip to main content

pickFileFromFiles()

Call Signature​

pickFileFromFiles(options): Promise<FileInfo[] | null>

Defined in: js-api/ui.ts:539

Opens the platform's 'Select a file' dialog over the file shares tree, or over the files of one share. Resolves with the file double-clicked, or the file or folder selected on OK (its FileInfo.fullPath names it on the share) — with multiple, with all of them — or null when the dialog is closed without a pick.

Parameters​

ParameterType
optionsIPickFileOptions & object

Returns​

Promise<FileInfo[] | null>

Example​

const file = await ui.pickFileFromFiles();
if (file !== null)
grok.shell.info(file.fullPath);
const files = await ui.pickFileFromFiles({multiple: true});

See​

https://public.datagrok.ai/js/samples/ui/dialogs/pick-file

Call Signature​

pickFileFromFiles(options?): Promise<FileInfo | null>

Defined in: js-api/ui.ts:540

Opens the platform's 'Select a file' dialog over the file shares tree, or over the files of one share. Resolves with the file double-clicked, or the file or folder selected on OK (its FileInfo.fullPath names it on the share) — with multiple, with all of them — or null when the dialog is closed without a pick.

Parameters​

ParameterType
options?IPickFileOptions & object

Returns​

Promise<FileInfo | null>

Example​

const file = await ui.pickFileFromFiles();
if (file !== null)
grok.shell.info(file.fullPath);
const files = await ui.pickFileFromFiles({multiple: true});

See​

https://public.datagrok.ai/js/samples/ui/dialogs/pick-file

Call Signature​

pickFileFromFiles(options?): Promise<FileInfo | FileInfo[] | null>

Defined in: js-api/ui.ts:541

Opens the platform's 'Select a file' dialog over the file shares tree, or over the files of one share. Resolves with the file double-clicked, or the file or folder selected on OK (its FileInfo.fullPath names it on the share) — with multiple, with all of them — or null when the dialog is closed without a pick.

Parameters​

ParameterType
options?IPickFileOptions

Returns​

Promise<FileInfo | FileInfo[] | null>

Example​

const file = await ui.pickFileFromFiles();
if (file !== null)
grok.shell.info(file.fullPath);
const files = await ui.pickFileFromFiles({multiple: true});

See​

https://public.datagrok.ai/js/samples/ui/dialogs/pick-file