Image Picker

The Image Picker action allows users to pick images or videos from their device camera or gallery. It supports customization such as media type, resolution limits, image quality, and multiple file selection.

Use Cases

  • Allowing users to upload profile pictures or photos.

  • Capturing media from the camera or selecting existing media from the gallery.

  • Attaching media to forms, posts, or messages.

Properties

Property
Description

mediaSource

The source for selecting media: "camera" or "gallery".

cameraDevice

Optionally specify which camera to use ("front" or "rear"), if mediaSource is "camera".

mediaType

Type of media to select: "image" or "video".

allowMultiple

Boolean indicating whether multiple files can be selected. Defaults to false.

maxWidth

Maximum width for selected images.

maxHeight

Maximum height for selected images.

imageQuality

Quality of the image (0–100).

maxDuration

Maximum duration for selected videos (in seconds).

fileVariable

Expression where the selected media file(s) will be stored (e.g., a state variable).

Default Behavior

  • Opens the device’s image or video picker with the configured options.

  • Selected media is stored in the specified fileVariable.

  • By default, only one image or video can be selected unless allowMultiple is enabled.

How to Use

  1. Attach the action to a widget (e.g., tap on an avatar or camera icon).

  2. Select Image Picker from the action list.

  3. Configure the source (mediaSource), media type, and limits.

  4. Assign the selected media to a variable using fileVariable.

Last updated