SharePoint Online - Get attachment names
Use the SharePoint Online - Get attachment names action A tool for building the processes, logic, and direction within workflows. to retrieve all the attachment names from a list item. This action works with the SharePoint Online - Get item attachment by name action.
For more information about the SharePoint Online connector, go to SharePoint Online.
Configure the SharePoint Online - Get attachment names 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.
-
Add the action to the workflow and open the action configuration panel. For more information, see Add an action to the workflow.
- Select a Connection. If you do not have a connection, see Add a connection.
- Type a SharePoint site URL and click Retrieve lists.
Only the connections created with the List and libraries authentication method are available in the drop-down list. For more information, see Connectors.
Example:https://domain.sharepoint.com/sites/hr
- Select the List name that contains the item where you will get attachment names from.
- For Item ID, specify the ID of the list item that you want to retrieve attachment names from.
For more information about Item ID, see How do I find the item ID in the SharePoint Online list? .
- For Result, create or select an object to store the attachment file names.
Retrieve attachments from a list item
The following actions can be used together to retrieve attachments from a list item as described in the steps below:
- SharePoint Online - Get attachment names (this action)
- Loop for each
- SharePoint Online - Get item attachment by name
-
Store attachment file names to a collection variable using the SharePoint Online - Get attachment names action
- Add the SharePoint Online - Get attachment names action to the workflow and open the configuration panel.
-
Access the list that contains the list item you want for the operation
-
Select a SharePoint Online Connection.
-
Type a SharePoint site URL.
Example:https://domain.sharepoint.com/sites/hr
- Click Retrieve lists. Existing lists in the site is retrieved and displayed in the List name drop-down.
-
Select the List name that you want.
-
- 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.
- For Result, click Add variable > Create variable.
- For Name, type attachmentnames and click Create & insert.
-
Loop through the collection variable to retrieve each attachment
- Add the Loop for each action to the workflow after the SharePoint Online- Get attachment names action and open the configuration panel.
- To select the Target Collection, do the following:
- Click Insert.
- In the variable panel, select SharePoint Online > attachmentnames > Attachment name(s) and click Insert.
-
Get each attachment using the SharePoint Online - Get item attachment by name action
- Add the SharePoint Online - Get item attachment by name action to the drop zone () in the loop construct.
- Click the SharePoint Online - Get item attachment by name action to open the configuration panel.
-
Access the list that contains the list item you want for the operation
-
Select a SharePoint Online Connection.
-
Type a SharePoint site URL.
Example:https://domain.sharepoint.com/sites/hr
- Click Retrieve lists. Existing lists in the site is retrieved and displayed in the List name drop-down.
-
Select the List name that you want.
-
- 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.
- For Attachment name, do the following:
- Click Insert.
- In the Loop for each variable section, select Loop for each > Current item and click Insert.
-
For Result, do the following:
- Click Add variable > Create variable.
- For Name, type attachmentOutput and click Create & insert.
SharePoint Online - Get attachment names 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) |
SharePoint Online connection for the list containing the item(s) with attachment names that you want to retrieve. To refresh the available connections , click . |
(n/a) | |
Source item |
SharePoint site URL |
The URL of the SharePoint Online site containing the list or document library you want to use. To retrieve the lists or libraries for the SharePoint site URL, 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. The drop-down list is limited to lists within the site specified in 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. How do I find the item ID in the SharePoint Online list?
The ID column is added to the list. |
Integer |
|
Output | Result |
Stores the result of the action as an object with the following variables:
|
Object |