---
title: "document-has-attachment"
description: "Optimize document handling with the document-has-attachment evaluator in configuration settings. (Gitana 4.0)"
product: "Gitana"
version: "4.0"
url: "/documentation/gitana/4.0/developers/ui-dev/evaluators/document-has-attachment"
---

# document-has-attachment

If the document has a given attachment.

```
{
    "evaluator": "document-has-attachment",
    "condition": "{attachmentId}"
}
```

## Example

This block, taken from the [Configuration](/documentation/gitana/4.0/developers/ui-dev/configuration.md) docs, uses `document-has-attachment` inside an `and` evaluator. The `custom-download-scan` document action is only included if the document is both a file and also has a `scan` attachment.

```
{
    "evaluator": "and",
    "condition": [{
        "evaluator": "document-is-file"
    }, {
        "evaluator": "document-has-attachment",
        "condition": "scan"
    }],
    "config": {
        "document-actions": [{
            "id": "custom-download-scan"
        }]
    }
}
```

## See also

- [Configuration](/documentation/gitana/4.0/developers/ui-dev/configuration.md)
- [and](/documentation/gitana/4.0/developers/ui-dev/evaluators/and.md)
- [document-is-file](/documentation/gitana/4.0/developers/ui-dev/evaluators/document-is-file.md)
