# Attachments

### Add attached file (from bytes)

Upload a file as an attachment to task item.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter            | Description                                    |
| -------------------- | ---------------------------------------------- |
| Custom List app name | Name of Custom List app in SharePoint (not id) |
| Item ID              | ID of item                                     |
| Remote filename      | Remote filename                                |
| Source bytes         | Table (consisting of bytes) to read from       |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description                                  |
| ---------- | -------------------------------------------- |
| 1000       | Unspecified error.                           |
| 1000001    | User is not authorized to perform operation. |
| 1000004    | Item with given id does not exist.           |

### Add attached file (from file system) <a href="#add-attached-file-from-file-system" id="add-attached-file-from-file-system"></a>

Upload a file as an attachment to task item.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter            | Description                                                                                                            |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| Custom List app name | Name of Custom List app in SharePoint (not id)                                                                         |
| Item ID              | ID of item                                                                                                             |
| Remote filename      | Remote filename                                                                                                        |
| Local filename       | Full path to file to upload. Note that the user the application pool running Flow Server must have access to the file. |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description                                  |
| ---------- | -------------------------------------------- |
| 1000       | Unspecified error.                           |
| 1000001    | User is not authorized to perform operation. |
| 1000004    | Item with given id does not exist.           |

### Add attached file (from stream) <a href="#add-attached-file-from-stream" id="add-attached-file-from-stream"></a>

Upload a file as an attachment to task item.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter            | Description                                    |
| -------------------- | ---------------------------------------------- |
| Custom List app name | Name of Custom List app in SharePoint (not id) |
| Item ID              | ID of item                                     |
| Filename             | Remote filename                                |
| Source stream        | Simple variable containg a stream              |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description                                  |
| ---------- | -------------------------------------------- |
| 1000       | Unspecified error.                           |
| 1000001    | User is not authorized to perform operation. |
| 1000004    | Item with given id does not exist.           |

### Delete all attached files <a href="#delete-all-attached-files" id="delete-all-attached-files"></a>

Delete all attachments on provided task item.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter            | Description                                    |
| -------------------- | ---------------------------------------------- |
| Custom List app name | Name of Custom List app in SharePoint (not id) |
| Item ID              | ID of item                                     |
| Filename             | Remote filename                                |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description                                  |
| ---------- | -------------------------------------------- |
| 1000       | Unspecified error.                           |
| 1000001    | User is not authorized to perform operation. |
| 1000004    | Item with given id does not exist.           |

### Delete all attached files <a href="#delete-all-attached-files" id="delete-all-attached-files"></a>

Delete all attachments on provided task item.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter            | Description                                    |
| -------------------- | ---------------------------------------------- |
| Custom List app name | Name of Custom List app in SharePoint (not id) |
| Item ID              | ID of item                                     |
| Filename             | Remote filename                                |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description                                  |
| ---------- | -------------------------------------------- |
| 1000       | Unspecified error.                           |
| 1000001    | User is not authorized to perform operation. |
| 1000004    | Item with given id does not exist.           |

### List attached files <a href="#list-attached-files" id="list-attached-files"></a>

Lists all files attached to specified item.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter            | Description                                    |
| -------------------- | ---------------------------------------------- |
| Custom List app name | Name of Custom List app in SharePoint (not id) |
| Item ID              | ID of item                                     |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not. If succesful, result of operation is stored in Results member

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |
| Results      | Table variable containing the results of operation                     |

Structure of Results Results

&#x20;Filename

&#x20;ServerRelativeUrl

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description                                  |
| ---------- | -------------------------------------------- |
| 1000       | Unspecified error.                           |
| 1000001    | User is not authorized to perform operation. |
| 1000004    | Item with given id does not exist.           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.novacuraflow.com/6.11/development/flow-studio/connectors/business-systems/microsoft-sharepoint-2013/generic-operations/custom-list/attachments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
