Skip to main content
Files in Mapsly

Let your your Mapsly users upload images and documents to Mapsly to view them later, or save to your CRM.

Sergey Shurygin avatar
Written by Sergey Shurygin
Updated over a month ago

Mapsly can store files, which can be viewed in Mapsly's user interface and accessed programmatically; for example, to be sent to external systems like a CRM.

Files can be uploaded to Mapsly in two ways: using a File field on a Form, and by directly editing a Files field in a Mapsly object like Route activity or Check In. To use a Form to upload files is the recommended option, as it allows you to specify the file of files that can be uploaded and the target size for an image or video so Mapsly can compress it during uploading.

It is possible to upload files of any type, including documents, images (including e-signatures), as well as audio- and video-recordings.

Using the Mapsly mobile app on a mobile device, users can take photos directly from the app. Any of such files can then be sent as attachments to your CRM or any other external system (if it has a way to accept files via its API).

An image can also be drawn on the screen in Mapsly, which can be useful, for example, to collect e-signatures from delivery recipients.

If the object/module in your CRM to which you'd like to save files doesn't support attachments or your CRM doesn't accept files via its API, you may also save links to Mapsly files to your CRM fields, and when your CRM users click on them, files will open in Mapsly.

Files can be uploaded from shared maps as well; in other words, users are not necessarily required to be logged in to Mapsly to take photos and upload files (although they do need to be logged in to view or modify uploaded files).

Files overview: uploading, accessing, sending to CRM

Typically, to let your users upload a file to Mapsly, you'll be using a Form action with a File form field. On such a form, users will be able to upload one or multiple files using any of the methods allowed in the File form field properties. If the File field allows images, users will be able to take photos using device's camera directly from the Mapsly mobile app or upload them from the device's gallery; upload a file from the disk; or make a drawing (which is especially useful for collecting signatures from delivery recipients. The Files field property also specify the minimum and maximum allowed number of files, so one File field may be used to upload multiple files at once.

When user selects files to upload (or makes a drawing, or takes a photo using the camera), the file is immediately stored as a record in the Mapsly's Files system object, and its ID is stored in the Files form field value. As user continues to upload more files, their IDs are appended to the same Files field's value, so the resulting value is an array of file IDs.

When a user triggers an event on the Form, like clicking a form button, your actions in the event's handler can access the file IDs in the Files form field, their properties including their permanent URLs, and their content. In your actions, you can do the following (in any combination):

1- You may simply save the value of the Files form field to the Files field of the target record in Mapsly. Users viewing the target record will also be able to view these files, or even modify them (if their profile grants them the Modify permission to the Files field — more details about it below).

Note. Currently, the system objects Route activities and Check In are the only two objects containing a Files field. So uploaded files' ID can be saved directly to a Route activity or Check In record and viewed in their records.

2- For each of the uploaded files a permanent Mapsly link is generated, which you can access for any of the IDs stored in the Files form field value using GetFileProperties(fileId).file_url. To access this link, a user should be logged in to Mapsly. If your CRM doesn't support attachments, you can save this link to a CRM field, so your users can open Mapsly files directly from the CRM.

3- You can create a temporary direct link to your file using the GetFileURL() function, which can be useful for generating temporary HTML at the time of viewing, for example, to insert images (stored in Mapsly) to HTML form fields.

4- You may save uploaded files directly your CRM, for example, as attachments to a record into which your users is checking it. To retrieve the file content, use the GetFileContent() function. These articles will help you save files directly to your CRM:

Note. If a user closes the Form by clicking Cancel, newly uploaded files are automatically removed.

All users with access to File system object can access Mapsly files

Any user, including anonymous users of a shared map, can upload files using a Form, as long as they are permitted to use this Form.

To view a Files field in a record in a map popup or record view, a user needs to have access to the File object in their user profile. If their profile permits them to modify the Files field, they'll be able to modify the field's content directly, that is to upload new files into that field and remove existing ones.

IMPORTANT! If a user has access to the File object, they can view any file as long as they either have a direct link to it (from GetFileProperties(fileId).file_url) or have access to a record with a Files field containing this file ID. At the moment, unlike for other objects, for records in Files Mapsly does not offer per-record access control. So once a user learns a file's direct URL (if you save it to your CRM) or obtains a file's ID (for example, by viewing the file in a Check In record), it is impossible to "revoke" user's access to this particular file.

Limits and billing

Each Mapsly org account comes with 5 Gb of file storage. When the limit is exceeded, the current limit is automatically increased in 5 Gb increments with appropriate fee being automatically added to the current subscription price starting from the next billing cycle, similar to how the record fee works.

Removing orphaned files

In early 2023, we'll offer admin an opportunity to view orphaned files — files without references from Files fields in any record — and quickly remove such files to free up storage space, if necessary.

Editing a Files field

Using a Form to edit a Files field

A Form action with a Fields form field can be also used to edit an existing Files field — to do this, simply fill in the initial value of the Files form field with the current value of the Files field from a record using Twig, and Mapsly will show the current files in the Form and will allow the user to add new files, or remove existing ones. Then, simply save the updated value from the Files form field to the record's Files field.

When using a Files field to store images, we strongly recommend using a Form to edit the field's value, since a Form allows you to (1) set the target image size to conserve file storage, (2) control the min and max number of files that a user can/must upload and (3) restrict the type of files that can be uploaded (for example — only images).

Editing files in a map popup or record view panel

If a user's profile permits modification of a Files field, the user can edit the Files field directly in a record's map popup or record view right panel — similar to any other field.

When using a Files field to store images, we do not recommend allowing users to edit FIles fields directly, because this method does not let you (1) set the target image size, (2) control the min and max number of files that can be uploaded into a Files field or (3) restrict the type of files that can be uploaded (for example — only images). We recommend using a Form action to edit Files fields with images.

See also:

Did this answer your question?