share

Easily share your files directly from the app with just a tap. Whether it's a document, image, or report, the share action lets you quickly send files via apps on the device, such as email, messaging apps, or AirDrop.

Share images
Share images

Configuration options

Some properties are common to all components, see Common component properties for a list and their configuration options.

Core structure

email

Provide an email address, this optional property allows a string or expression. It is used to set the To address if sharing with email. If an email is supplied the share action will automatically open up the default email app on the phone to compose and fill in the supplied details. If email is not supplied, you will be able to share via other methods or apps. For iOS you can only supply a single email address. If you supply more, the To field will be left blank. This is not an issue on Android but for consistency it is best to keep to one email address.

fileUri

Provide the uri for the file you want to share, either from a datasource, in an expression, or from an action, such as the action.generate-pdf. You can reference the PDF or the local uri of the PDF document using the action's output uri [email protected]. The fileUri needs to be the full uri of the local file.

message

Add a text message to send with the shared file.

subject

Add a subject when sharing the file. The subject will only appear in apps that support a subject property, such as email.

title

Provide the action button with a title, for example, Share file.

Considerations

  • All properties are optional but you need to at least supply a message or fileUri.

  • You can select from the apps or methods available on your device for sharing.

  • This means you can share a piece of text without a file.

  • You can also share one or more files. If there is more than one file it needs to evaluate to a string array.

  • For best results, share files that are stored locally (e.g., images or PDFs). Files stored in a datasource as base64, data URI, or buffers will be returned as unreadable binary (.bin) files.

Examples and code snippets

Share images

Share images
Share images

In this example, a foreman takes multiple images of the job and saves the images to Dynamic Data. When the images are successfully saved the images are shared via the devices message sharing apps.

Example: See the full code sample in GitHub.

Generate a pdf, save and share

In this example, an action list contains three actions: the first generates a PDF for an invoice, the second saves it to the database, and the third shares the PDF via a messaging app on the device. The file is saved to dynamic files.

Example: See the full code sample in GitHub.

Share by email

Share by email
Share by email

In this example, we demonstrate using the action.share to send an email to a customer with an attachment. The message, subject and email (To) properties are configured as part of the action.

Example: See the full code sample in GitHub.

For best results, share files that are stored locally (e.g., images or PDFs). Files stored in a datasource as base64, data URI, or buffers will be returned as unreadable binary (.bin) files.

Last updated

Was this helpful?