---
title: Get Attachment IDs as a File Use Case
slug: get-attachment-ids-as-a-file-use-case
docTags: 
createdAt: 2025-08-11T11:13:49.000Z
---

## Scenario

Alex is an analyst who has already set up her Gmail account so that her playbook retrieves a list of emails. Alex now wants to enhance the playbook to retrieve attachment IDs as a file.

## First

First, Alex repeats steps 1-4 from [Get GMail Emails List](https://docs.swimlane.com/get-gmail-emails-list-use-case). To accomplish getting email attachments in a file, Alex needs to use a series of Google connector actions. However, for best practices, Alex is going to use the Turbine Loop native action to ensure data iterates to receive an array of items, iterate through that array performing action(s) on each item, and reduce the need for configuring a repeated nested playbook action to apply more than one action to each item in an array.

## Let's Dive In

After completing steps 1-4 from [Get GMail Emails List](https://docs.swimlane.com/get-gmail-emails-list-use-case), Alex follows these steps:

1. Select an **On Success** action flow, and then add the **Loop** native action.
   Alex titles the loop: **Iterate over emails**.
2. From the ACTION panel, click **Select property or expression&#x20;**&#x61;nd selec&#x74;**&#x20;Playbook property.**

Alex clicks the Get List Emails action and selects the Messages property. Doing this ensures the ID array sub-property will be passed downstream in the playbook.

::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/jjbjCrxASt1N9VQilzKTm_get-attachments-in-file-use-case-1.png" size="62" width="955" height="739" darkWidth="800" darkHeight="618" position="center" showCaption="false"}

1. Next, add the **GMail - Get Email by ID** action.
2. From Available Assets, select **Google\_Workspace** to apply required credentials.
3. Under Action Inputs, enter the User ID.
4. In the User ID field, enter the same user ID that you entered in the **GMail - List Emails** connector.
5. Click **select a property** and click **Playbook property**.

From the playbook properties, click the Iterate Over Emails Loop. From the list of properties, Alex selects the ID string property. Once she does, the dynamic value displays in the ID field under Action Inputs. Alex clicks Apply to save changes.

::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/-kQmsNLPeWmDkUXz6ua3t_get-attachments-in-file-use-case-2.png" size="76" width="1783" height="765" darkWidth="800" darkHeight="343" position="center" showCaption="false"}

Alex is ready to add another Loop native action, so she repeats Step 1. Alex titles the loop: **Get Attachments**.

1. From the ACTION panel, click **Select property or expression&#x20;**&#x61;nd selec&#x74;**&#x20;Playbook property.**

From the playbook properties, click the Get Email by ID action. In this case, Alex must select the Parts array property to get the Attachment ID property. There is now a nested loop in this playbook. 

::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/iocGdfJmoK2z3TJvD0Qm9_get-attachments-in-file-use-case-3.png" size="72" width="955" height="711" position="center" showCaption="false"}

Only a few steps remaining!

1. Add an action and select **GMail - Get Email Attachment&#x20;**&#x61;nd clic&#x6B;**&#x20;Configure.**
2. Add your **User ID** again.
3. Add the **Google\_Workspace** asset again.
4. In Message ID, click **select a property** and click **Playbook property**.
5. In Attachment ID, click **select a property** and click **Playbook property**.

From the playbook properties, click the Get Email Attachment action. In this case, Alex selects the Attachment ID string property.

::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/b73GtRj9BOY9lacjBZm-B_get-attachments-in-file-use-case-4.png" size="66" width="883" height="744" position="center" showCaption="false"}

Alex clicks Apply to save her changes.

## Conclusion

Alex successfully used Turbine's Google Workspace connector, Google Authentication assets, and Loop native actions to automate a playbook to get attachment IDs as a file.
