Roboteka
Roboteka · Robots · Delete file from CRM card

Delete file from CRM card

The Delete File from CRM Card robot deletes a file from a file field of a Bitrix24 (Alaio) CRM entity — a deal, contact, company or lead — by index (0 = first, -1 = last), or clears the whole field if the index is left empty. The inputs are the entity type, its ID, the file field code and the index. It returns a success flag (Y/N) and the number of remaining files.

The robot removes attachments from a CRM entity file field right inside a business process. The inputs are: the entity type (deal, contact, company or lead), the entity ID, the file field code and the file index. If the index is left empty, the whole field is cleared; index 0 deletes the first file, -1 the last, negative values count from the end, and an out-of-range index is clamped to the nearest existing one. The outputs are: success — a flag of Y when the card was updated successfully, otherwise N, and remaining — how many files are left in the field after deletion. Use it to remove an outdated contract draft on a deal stage change, clear temporary attachments after processing, or drop one excess file while keeping the rest. If the parameters are invalid or the entity is not found, the robot returns success N; for an already empty field it returns success Y and remaining 0. The success and remaining outputs can be compared in the condition of the next step of the business process.

What input parameters does the robot accept?

Parameter Type Required? Default
Entity type: deal / contact / company / lead string yes
Entity ID int yes
File field code string yes
File index to delete (0 = first, -1 = last). Leave empty to clear the entire field string

What does the robot return?

Parameter Type
Success (Y/N) string
Files remaining after deletion int

Scenario: clear temporary attachments after approval

  1. A deal enters the Approved stage
  2. The robot deletes the first file from the drafts field (index 0)
  3. The remaining output returns the number of files left, success shows Y or N

Related robots

Related articles