Take photo

Opens the device camera, allowing the user to take a photo.

Opens the device camera, allowing the user to take a photo.

The taken photo is stored in a temporary directory with an autogenerated unique identifier for its filename. If you need to save the photo in a persistent way, use the Move file flow function to move it to the user files directory.

If the Cancel button is pressed, the second output is triggered.

If taking the photo throws an error, the third output is triggered with the error.

Input arguments

Label

Key

Type

Required?

Default

Description

Capture button label

captureLabel

String

Yes

Capture

Text label on the capture button.

Cancel button label

cancelLabel

String

Yes

Cancel

Text label on the cancel button.

Output arguments

Number of outputs: 3

Label

Key

Type

Description

Photo file

photoFile

Object

Object representing the captured photo file in the local filesystem.

  • Local path

photoFile.path

String

Absolute local filesystem path representing the file location on the device, including the filename and extension. On web, this is created via the [`createObjectURL`](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL) method.

  • MIME type

photoFile.mimeType

String

MIME type of the file, if it could be determined.

  • Name

photoFile.name

String

Name of the file in the local filesystem, if applicable. Note that the filename and extension are included in the **Local path** property already.

  • Size

photoFile.size

Number

Size of the file, in bytes.

  • Created at

photoFile.createdAt

String

Creation datetime of the file, if it can be determined.

  • Modified at

photoFile.modifiedAt

String

Datetime when the file was last modified, if it can be determined.

Events

No events.

Errors

Label

Code

Description

Unknown error

unknown

Thrown when calling the native API resulted in an unknown error.