The "File" field in Bitrix24 stores documents right in the CRM card: contracts, invoices, scans, photos of objects. Out of the box files are uploaded by hand, but the routine can be taken off your plate with robots: attach a file by URL from an external system, count attachments before a stage change, get a download link for a notification, delete outdated versions. This article covers how to set up a file field and four scenarios for automating it.
What is the "File" field and why is it in the card?
"File" is a type of custom field in CRM: the document is stored right in the card of a deal, contact, company or lead. Unlike a link to an external drive, a file in a field won't get lost when folders are reorganized, and it's visible to everyone with access to the card. The field can be multiple — then it holds several files at once, all versions of a contract, for example. Typical uses: a contract and invoice in a deal, scanned documents in a contact, incorporation documents in a company, a photo of the object in a smart process. The closer the document is to the deal, the less time is spent finding it — that's the point of file fields.
How do I add a file field to a card?
A file field is created like any custom field: from the card or in the CRM field settings, choose the "File" type and, if needed, tick "multiple". The field gets a code like UF_CRM_ followed by a number — you'll need it for robots and the API (how codes and field types work is covered in the article on fields in Bitrix24). A practical tip: set up separate fields for different classes of documents — "Contract", "Invoices", "Closing documents" — rather than one catch-all "Documents". That way automation can check for a specific document rather than files in general, and the card shows at a glance which document is missing.
How do I auto-attach a file by URL?
If an external system — a document generator, accounting software, a proposal builder — hands back a ready file by URL, you don't have to download and attach it by hand. The Download file by URL and attach to card robot downloads the file by link and puts it into the file field of a deal, contact, company or lead; you can set your own file name or keep the one taken from the URL. It returns a success flag of Y/N and the name of the attached file — and on that flag the process branches into "document received" and "retry later or notify the rep". The link must be direct and reachable from outside — the robot downloads the file as an ordinary external client. The robot is available on paid Bitrix24 plans.
How do I check attachments and get a link to a file?
A pair of robots reads a file field without a human involved. Count files in field returns the number of attachments and a "has files" flag of Y/N — a ready-made "are documents attached" check before a stage change: on N the deal doesn't move on and the rep gets a task to attach what's missing. Get file link from card returns the download link, the file name and size; the index selects the first (0) or last (-1) file of a multiple field. The link is then dropped into a notification to a manager or an email to the customer — the recipient downloads the document without logging into the CRM, and the size in bytes helps screen out empty files. Together the robots close the control loop: checked that it's there, handed the link to the right person.
How do I delete files from a field automatically?
A multiple file field turns into a dump of versions over time. The Delete file from card robot deletes a file by index — first (0) or last (-1) — or clears the field entirely if no index is given; it returns a success flag and the number of remaining files. Use cases: after the final version of a contract is signed, clear the "Drafts" field; keep only the current document in the "Invoice" field by deleting the old one before attaching a new one; on deal completion, remove the interim files and keep the final ones. The order of steps in the process keeps it safe: the new version is attached first, then the old one is deleted. The number of remaining files is handy to check in the next process step — that way you can see the cleanup worked as intended.
Conclusion
A file field keeps documents where people work with them — in the deal or customer card. Attaching by URL, checking attachments, handing out a download link and clearing out old versions take manual operations off the rep. These robots are gathered in the Roboteka catalog; for generating the documents themselves, see the article on document templates. Missing the robot you need? Describe the task and we'll build it for free.