1. Home
  2. Tutorials
  3. Using Native Functionality
  4. Import and Preview User Files

Import and Preview User Files

ios file browser
Your app can import and preview user files via the device document picker app. By allowing the user to select a file, you can retrieve its location and build that into further processing, including loading a preview of the file for viewing.

  1. Add the Open Document Picker Action to an Event in your app, such as the Tapped Event of a Button Element. Select all of the file types / formats you want the user to be able to import, or choose All Documents.

    open document picker

    When the Action runs, the user will navigate to the document picker app on their device, which will provide access to any files on the device or any available cloud providers storing user files.

  2. When the user selects a file in the picker app, they will return to your app, and the nested Document Picked Event will fire. Here you can access information about the file chosen by the user, so you can build it into subsequent processing. Add an Action to the Event, for example Show File Preview from URL to present a preview of the file. Use the Event Data container to access the chosen file location (and any associated data you might need for other functionality).

    preview file

    Enter a title for the file preview, pulling the value from one of the input sources in your app or entering it manually as a Static Input String value.

    file preview action

  3. Add Actions to the Preview Window Closed and/or Document Picker Cancelled Events if you want to respond to the user closing the preview or cancelling file selection.

What the user sees when their document picker app launches will depend on the setup on their device in terms of files they have stored locally or cloud providers they use, but your app can utilize the native apps available to both import and preview external file content.

android file browser
Your app can import and preview user files via the device document picker app. By allowing the user to select a file, you can retrieve its location and build that into further processing, including loading a preview of the file for viewing.

  1. Add the Pick a Document Action to an Event in your app, such as the Tapped Event of a Button Element. Select the file types / formats you want the user to be able to import, or choose All.

    pick a document

    When the Action runs, the user will navigate to the document picker app on their device, which will provide access to any files on the device or any available cloud providers storing user files.

  2. When the user selects a file in the picker app, they will return to your app, and the nested Document Picked Event will fire. Here you can access information about the file chosen by the user, so you can build it into subsequent processing. Add an Action to the Event, for example Preview a Document to present a preview of the file. Use the Event Data container to access the chosen file location.

    preview document

  3. Add Actions to the Document Picker Cancelled Event if you want to respond to the user cancelling file selection.

What the user sees when their document picker app launches will depend on the setup on their device in terms of files they have stored locally or cloud providers they use, but your app can utilize the native apps available to both import and preview external file content.

Was this article helpful to you? Yes No

How can we help?