> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Attachment

> Attachment

This element adds the attachment field to your screen.

## Configuration

| Setting      | Description                                                                                      |
| :----------- | :----------------------------------------------------------------------------------------------- |
| label        | UI label                                                                                         |
| multiple     | Allows uploading of several attachments                                                          |
| noHardDelete | Whether to delete the actual attachment from the database, or only from the attachment component |

## Example

```crmscript theme={null}
label = Attachments
multiple = true
```

## Functions

### setValue(String ids)

The string should contain a comma-separated list of attachment IDs.

### setFieldValue(String action, Map values)

| Action        | Map keys     | Description                          |
| :------------ | :----------- | :----------------------------------- |
| addAttachment | attachmentId | Adds an attachment with the given ID |

<Tip>
  To add multiple attachments, use `setFieldValue` once for each attachment.
</Tip>

### toInteger()

Returns the ID of a field as a number

### toString()

Returns a comma-separated list with the IDs of all attachments.


## Related topics

- [attachment](/en/api/mdo-providers/reference/attachment.md)
- [Attachment](/en/automation/crmscript/reference/CRMScript.Native.Attachment.md)
- [Attachment location](/en/onsite/config/service/attachment-location.md)
- [Archive attachments](/integrations/mail-link/archive-attachment.md)
- [attachment table](/en/database/tables/attachment.md)
- [Validate Attachments](/en/api/reference/restful/agent/ticket_agent/validate-attachments.md)
- [Add Attachments](/en/api/reference/restful/agent/ticket_agent/add-attachments.md)
