Search…
⌃K
Links

importFile

To import a file from a URL and save it as an attachment of a record
With this function, you can import a file and attach it to a record or insert it in an image field.
The file can be pulled/retrieved from an external URL. But with printAndSaveRecord() you can also attach an extra created file.

Syntax

importFile(nid, string)
importFile(nid, link)
importFile(nid, string, string)
importFile(nid, link, string)

Return

file

Examples

importFile(record, link, fileName) To import a file from a given URL string and save it as an attachment of a record.
1
importFile(this, "https://ninox.com/example.jpg", "Image.jpg")
Result: The file provided via the given link is attached to the current record with the name Image.jpg.
​
1
Invoice := importFile(this, printAndSaveRecord(this, "Invoice layout"))
Result: Prints the current record in the Invoice layout to a PDF and saves the file in the Invoice image field.

See also

​printAndSaveRecord, which saves a given record in a given layout as a PDF in the internal file system and returns a link to the file.
​file, which returns a specific file based on the file name from a given record.
​files, which returns all attachments of a record as an array.
Last modified 1mo ago