Can I save attachments to LocalDB objects?

I am adding on an attachment feature to a view that clones OnlineDB objects to LocalDB objects and displays them in an object table. When selecting an object the display-file component needs to appear for a user to download the attachment. Is it possible to save an attachment to a LocalDB field or does it only store a reference to the id?

When I log the attachment field the console prints Attachment{id: be36c5b8-2107-11ea-ac51-0a7849b2581d}.

Your assumption is correct, the DB only stores a reference to the attachment that is stored on an AWS bucket. Attachment do not download alongside a DB record and is only retrieved on demand if its not already on the device.

If you require the ability to store the attachment offline, you will need to Base64 encode this attachment to enable storing of the attachment with the DB record in a text field. This is not a recommended approach of storing a lot of attachments or frequently changing attachments.

1 Like