Jump to content

File column

From Resco's Wiki
Warning Work in progress! We are in the process of updating the information on this page. Subject to change.

File columns on Dataverse are a type of table column that can hold binary data. Since release 16.0, file columns can be also used in Resco mobile apps.

What are file columns

Dataverse introduced file columns in late 2019. They represent an alternative to traditional notes. Microsoft recommends using file columns for file sizes >5M.

File is just another column type. Unlike conventional column types such as "Single line of text" (storing strings) or "Lookup" (storing references to CRM records), file columns store files. Files are stored in the Dataverse File Storage (actually in Azure) and not in Dataverse, i.e., they do not consume database space. (This applies to all types of attachments.)

Any number of file columns can be added to standard/custom tables. When adding a file column to a table, you can specify the maximum file size (default 32 MB, maximum 128 MB). This value cannot be changed later.

To learn more about this feature in Dataverse, see Microsoft documentation.

How are file columns supported in Resco mobile apps

In release 16.0, we have added basic support for File columns.

Preview In release 16.1 (available in the preview/beta channel), the support is improved:

What is supported in Resco

  • File and Filename fields are visible in Woodford. You can enable them in your projects.
    • File field - This field must be enabled. When added to a form, it is represented as a lookup with a label and a clickable filename.
    • Filename field - This field is optional. When you enable the file field, the filename is enabled as well. We don't recommend disabling it. When disabled, "Unknown" is presented on the form instead of the file name.
  • Files are treated like standard documents; you can use operations such as print, export, and email.
  • File fields are fully supported in offline mode. They are synchronized with other attachments. If a user tries to open a file that is not yet synchronized, it is immediately downloaded (if an internet connection is available) and displayed to the user. If the file is changed on the server once synced, it is only updated in the local database on the next synchronization. In online mode, files are not cached locally and are thus downloaded every time a user opens them.

What is not supported

  • Views - You cannot open the file from a view using commands (there is no OpenAttachment command). It can only be opened from forms.
  • Media tab - You cannot use the media tab to show files inline on the form (such as a signature).
  • Questionnaires - You cannot use files as storage for binary questions (such as images or signatures).
  • Form rules - It is impossible to access or modify file contents using form rules.
  • Resco JavaScript Bridge - it is not possible to get file content via JS bridge. As a workaround, it is possible to use a file identifier (guid) in the File field to construct the download URL and download the content manually from Azure storage (Microsoft documentation).

File column versus annotation

In a sense, file columns are similar to conventional attachment entities - notes etc., except they are conceptually simpler to use. If you want to use annotations related to (say) accounts, you need to add a new relation annotation->account and use a more complex UI - a media tab. (Images can use simpler image control.) If you need additional annotations (signature, image...) you have to organize multiple relations. In effect, the data schema gets more complex (in particular sync filters) which may negatively impact the performance.

File columns make most of these things simpler. If you need a 1:1 relation such as "product photo" or "PDF help file", add a File column to the table definition and a file control to the UI. No need to add a new relation or complicate sync filters; life is simply easier. However, if you have an N:1 relation (such as a variable number of images attached to an account record) File columns won't help - you have to use traditional note attachments instead.

Conclusions:

  • As far the app creation is concerned, File columns are easier to work with. However, if you need true N:1 relations, stick to annotations.
  • File columns offer simpler security - row-level security of the record where they reside applies. Annotations are different: they are associated records (with specified cascading behavior).
  • If you decide on file columns, expect weaker sync performance and only partially working filtering. This might become important if you use many attachments.
(Resco has plans to optimize file column sync in the future if this feature becomes more popular.)



{{#CI form: title = Was this information helpful? How can we improve? | type = inputs | [textarea] }}