# Insert

The `Insert` action inserts items into a repository.

Type: asynchronous

Parameter | Description | Required
--- | --- | ---
`ConnectorGroup` | The name of the connector group to send the request to. This must match the name you specified when you configured the ConnectorGroupRouter processor in your dataflow. | Yes
`Documents` | XML that describes how to insert the item(s). Each item to insert is represented by a `document` element in the XML:
    <documents>
        <document file_part_name="file_part">
            <IDENTIFIER>
                <reference>/opt/files/file.txt</reference>
                <type>File</type>
                <property name="..." value="..." />
                <property name="..." value="..." />
            </IDENTIFIER>
        </document>
    </documents>
The `file_part_name` attribute specifies the name of the part, in the `multipart/form-data` request, that contains the file to insert. The `IDENTIFIER` element contains information about where to insert the item. The information that you must supply is different for each repository, and therefore for each connector. The `reference` element is often used to supply a location, such as a path. The `type` element describes the identifier type (the type of item to insert). The value of this element matches what would be returned by the Identifiers action. Some repositories might need additional information, which can be supplied as a set of properties (name-value pairs). | Yes

## Example

The following example uses the command-line tool cURL to send an insert action.

This example uses a File System Connector Group to insert a file into the file system. The file to insert is `file.txt` in the current working directory.

    curl http://host:10000/action=Insert -F ConnectorGroup=FileSystem
                                         -F "Documents=<documents.xml"
                                         -F "file_part=@file.txt"

In this example, the XML that describes where to insert the item is read from the file `documents.xml` in the current working directory. This file might contain the following XML:

    <documents>
        <document file_part_name="file_part">
            <IDENTIFIER>
                <reference>/opt/files/file.txt</reference>
                <type>File</type>
            </IDENTIFIER>
        </document>
    </documents>

Notice that the value of the `file_part_name` attribute matches the name of the part, in the request, that contains the file to insert. The connector inserts the file into the file system at the location `/opt/files/file.txt`.

## Response

This is an asynchronous action, so you receive a token in response to the request. You can use the QueueInfo action to see the result of the action, including the identifiers of successfully inserted documents.

© Copyright 2018-2019 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a mail client, and then send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm