Search…
⌃K
Links

files

To return all attachments of a record as an array
In contrast to file() with this function, you can address all file attachments of a record, e.g. to send them as an attachment of an automatically generated e-mail or search for specific files in a table.

Syntax

files(nid)

Return

[file]

Examples

1
files(this)
Return: An array with all attachments of the current record.
1
count(files(this))
Return: 10 (If the current record has 10 attachments).
You (Steve Rogers) would like to send an email with the attachments of the current record to Hulk. This would be the script in the button within the record, that Steve would click to trigger the action.
1
sendEmail({
4
subject: "Importent documents",
5
text: "Here come the important documents!",
6
attachments: files(this)
7
})
Result: Hulk will receive an email with all the attachments of the current record.

See also

file, which returns a specific file based on the file name from a given record.
importFile, which imports a file from a URL and saves it as an attachment of a record.
Last modified 1mo ago