# pluck (FTP command)

### Overview

The `pluck` command retrieves a file, loads content into the process flow as a payload, and then deletes the file from the remote server.&#x20;

## Need to know

* You can pluck a single file or multiple files.&#x20;
* Regular expressions are supported when defining files to retrieve with the `get` command.

## Connection settings

When [configuring an SFTP connector](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/configuring-sftp-connections.md), two fields should be updated:

| FTP command               | Root                                                                                                                                       | Path                           |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ |
| FTP command only: `pluck` | <p>The root to the file(s) you want to pluck.<br><br>Since the root only applies to one directory, you can enter the full path here.  </p> | The filename(s) to be plucked. |

## Example

* [Scenario](#scenario)
* [The steps](#the-steps)

### Scenario

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><p>Our process flow is configured as follows:</p><div><figure><img src="/files/eJGgx1EzeOKq8GlFvUSO" alt=""><figcaption></figcaption></figure></div></td><td><a href="/files/rI8jPerjv9MFfSCvdBbq">/files/rI8jPerjv9MFfSCvdBbq</a></td></tr><tr><td>In this flow, we need to pluck all files in <code>/myfiles/folderB</code> that start with <code>orders</code> - so <code>orders.json</code>, <code>orders2.json</code>, <code>orders3.json</code>:<br><br><img src="/files/pAS6BkF9ibSATbFW7lwD" alt=""></td><td><a href="/files/2vpVY6Q37YrYqTgeZirK">/files/2vpVY6Q37YrYqTgeZirK</a></td></tr></tbody></table>

### The steps

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><p><strong>Connector settings</strong></p><p>Our SFTP shape is configured as follows: </p><div align="left"><figure><img src="/files/ie6PktshPK1i98yRl3fu" alt=""><figcaption></figcaption></figure></div><ul><li>Use the <code>SFTP GET user pass</code> endpoint.</li><li>Start looking for the file to rename from the <code>root</code>, which is defined as: <code>/myfiles/folderB/</code></li><li>Check the <code>path</code> for the file(s) to pluck, which is defined as: <code>/^orders.*/i</code>. This regular expression resolves to 'all files starting with 'orders', irrespective of upper/lower case.</li></ul></td><td><a href="/files/oMb9sRQ3X0NcUlY4i8Mk">/files/oMb9sRQ3X0NcUlY4i8Mk</a></td></tr><tr><td><p><strong>Payload &#x26; SFTP server</strong> </p><p>When the process flow is run, the payload for the SFTP shape shows the content retrieved from matched files. We have three payloads:</p><div align="left"><figure><img src="/files/qO0PgwaPQEoaW2Fdrjcl" alt=""><figcaption></figcaption></figure></div><p>On our remote server, all 'orders' files have been removed from <code>/myfiles/folderB/</code> and this directory is now empty:<br><br><img src="/files/jluBsCcBoQQwUFsfzkeq" alt=""></p><p></p></td><td><a href="/files/J6YFhcQQMgUmK2sBQwdu">/files/J6YFhcQQMgUmK2sBQwdu</a></td></tr></tbody></table>


---

# 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://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/configuring-sftp-connections/valid-ftp-commands/pluck-ftp-command.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.
