I’m working on a merge record script to be able to take two records and merge them together. This isn’t too bad for almost all of the field types except for the photo and file attachment types. How do I copy the attachments from one record to another for the file and photo fields?
If you’re copying the values from one record to another, when you call getFieldValue
on a field ID for a record, Tap Forms will store that record’s internal ID in the dictionary associated with each photo in that Photo field. Then when you call setFieldValue
on another record, Tap Forms will then use that internal record ID to get the attachment and set it on the destination record.
It does this both for Photo and File Attachment fields.
So it should hopefully just work
:)
Still working through this but one quirk is that I can copy the same attachment file name more than once to a record but if I use the UI to delete one of them, it breaks the other photo field attachments that were duplicated.