SharePoint on-premises - Get item attachment by name

The SharePoint on-premises - Get item attachment by name action A tool for building the processes, logic, and direction within workflows. Actions are the steps the workflow performs to complete a process. retrieves a specified attachment from a collection variable containing all attachment names for a given list item.

For more information about the SharePoint on-premises connector, go to SharePoint on-premises.

Configure the SharePoint on-premises - Get item attachment by name action

Important: Before inserting variables in the action configuration, you must manually type or select the values and populate other dependent fields in order to retrieve the output data. Once configured, you can insert variables to the required fields.

  1. Add the action to the workflow and open the action configuration panel. For more information, see Add an action to the workflow.
  2. In the Configuration section, select a SharePoint on-premises Connection. If you do not have a connection, see Add a connection.
  3. Type a SharePoint site URL and click Retrieve lists.
  4. Example:https://domain.sharepoint.com/sites/hr

  1. Select the List name that contains the item with the attachment that you want to retrieve.
  2. For Item ID, specify the ID of the list item that you want to retrieve the attachment from.
  3. For more information about Item ID, see SharePoint on-premises - Get item attachment by name.

Retrieve attachments from a list item

The following actions can be used along with SharePoint on-premises- Get item attachment by name to retrieve attachments from a list item:

You can retrieve attachments from a list item using SharePoint on-premises - Retrieve an item action as described in the steps below:

  1. Store attachment file names to a collection variable using the SharePoint on-premises - Retrieve an item  action.

  2. Loop through the collection variable to retrieve each attachment:

    1. Add the Loop for each action to the workflow after the SharePoint on-premises - Retrieve an item action.
    2. Click the Loop for each action to open the configuration panel.
    3. To select the Target Collection:
      1. Click Insert.
      2. In the variable panel, select SharePoint Online > attachmentnames > Attachment name(s) and click Insert.
  3. Get each attachment using the SharePoint Online - Get item attachment by name action:

    1. Drag the SharePoint Online - Get item attachment by name action to the drop zone () in the loop construct.
    2. Click the SharePoint Online - Get item attachment by name action to open the configuration panel.
    3. Access the list that contains the list item you want for the operation:

      1. Select a SharePoint Online Connection.

      2. Type a SharePoint site URL.

        Example:https://domain.sharepoint.com/sites/hr

      3. Click Retrieve lists. Existing lists in the site are retrieved and displayed in the List name drop-down.
      4. Select the List name that you want.

    4. For Item ID, specify the ID of the list item that you want to retrieve attachments from. You can insert a variable or type the value.
    5. For Attachment name:
      1. Click Insert.
      2. In the Loop for each variable section, select Loop for each > Current item and click Insert.
    6. For Result:

      1. Click Add variable > Create variable.
      2. For Name, type attachmentOutput and click Create & insert.

You can retrieve attachments from a list item using SharePoint on-premises - Query a list action as described in the steps below:

In the Designer page:

  1. Store attachment file names to a collection variable using the SharePoint on-premises - Query a list action.

  2. Loop through the collection variable to retrieve each attachment:

    1. Add the Loop for each action to the workflow after the SharePoint on-premises - Query a list action.
    2. Click the Loop for each action to open the configuration panel.
    3. To select the Target Collection:
      1. Click Insert.
      2. In the variable panel, select SharePoint Online > attachmentnames > Attachment name(s) and click Insert.
  3. Loop through each attachment:
    1. Add another Loop for each action to iterate through the attachments associated with that item.
    2. Get each attachment using the SharePoint on-premises- Get item attachment by name action within this loop:

      1. Drag the SharePoint on-premises- Get item attachment by name action to the drop zone () in the loop construct.
      2. Click the SharePoint on-premises- Get item attachment by name action to open the configuration panel.
      3. Access the list that contains the list item you want for the operation:

        1. Select a SharePoint on-premises Connection.

        2. Type a SharePoint site URL.

          Example:https://domain.sharepoint.com/sites/hr

        3. Click Retrieve lists. Existing lists in the site are retrieved and displayed in the List name drop-down.
        4. Select the List name that you want.

      4. For Item ID, specify the ID of the list item that you want to retrieve attachments from. You can insert a variable or type the value.
      5. For Attachment name:
        1. Click Insert.
        2. In the Loop for each variable section, select Loop for each > Current item and click Insert.
      6. For Result:

        1. Click Add variable > Create variable.
        2. For Name, type attachmentOutput and click Create & insert.

SharePoint on-premises- Get item attachment by name action fields and settings

Important: Before inserting variables in the action configuration, you must manually type or select the values and populate other dependent fields in order to retrieve the output data. Once configured, you can insert variables to the required fields.

Section Field Description Variable types
(unlabeled)

Connection Credentials and other settings that enables workflows to communicate with external systems, services, or applications. It's required to pass data between the workflow and the indicated service, which could be a cloud service, business application, or content store.

SharePoint on-premises connection for the list containing the item with attachments that you want to retrieve.

To refresh the available connections, click .

(n/a)
Source attachment

SharePoint site URL

The URL of the SharePoint on-premises site containing the list you want to use.

To retrieve the lists from the SharePoint on-premises site, type the SharePoint site URL and click Retrieve lists.

Example:https://domain.sharepoint.com/sites/hr

Boolean, Collection, DateTime, Decimal, Integer, Text

 

List name

The name of the list containing the list item with the attachments you want to retrieve. Accepts a selection from the drop-down list.

The drop-down list is limited to lists within the site specified in the SharePoint site URL.

Boolean, Collection, DateTime, Decimal, Integer, Text

 

Item ID

The ID of the list item from which you want to retrieve the attachments.

Integer

 

Attachment name

The name of the attachment. Accepts any combination of typed text and inserted variables.

Boolean, Collection, DateTime, Decimal, Integer, Text

 
Output

Result

File variable to store the output from the action.

File