Find Items (Google Drive) v1.0.0 Help
Lists the files and/or folders stored in the selected folder of the connected Google Drive account that exactly match the defined item name.
How can I use the Step?
Use this Step to obtain details such as the type, name, and ID of all the files and/or folders that exactly match the defined item name and are contained inside the selected folder of the connected Google Drive account. This can be useful when you need to list items using an exact keyword.
How does the Step work?
You select an authorization connected to a Google Drive account, then define the item name, the search location, the item type, and the number of matches to list. When this Step is reached during execution, it lists all the found data in its output, and the Flow proceeds down the next
exit. An option to select the Flow behavior in case no items are found or the specified folder isn't found is available.
Prerequisites
To be able to use any Step from the Google Drive toolkit, first, you must do the following:
- Create a new or use an existing Google Cloud Project in your Google Cloud Console. To create a new project, follow these instructions.
- Create an Authorization by connecting your OneReach.ai account with the Google Cloud Project. Find the step-by-step instructions on how to do this in the collapsible group of the respective Authorization type modal window.
Authorization
To set up an authorization, do the following:
- Select the Authorization type in the dropdown.
- Select one of the two options:
- Click the Select authorization in current step option to select an authorization from the respective dropdown in this Step. Use this option when you need to:
- Create a new authorization;
- Select a previously created authorization manually.
- Select the Inherit from previous step option to choose the authorization used in the last executed Step of the Google Drive/Calendar toolkits in the Flow. Use this option when you have already created an authorization of the selected Authorization type and used it previously in the Flow.
Authorization type
The Google Drive and Google Calendar toolkits support two Authorization types:
The OAuth 2.0 authorization is used to authenticate as an end user and access user data in your app. It requires your app to request and receive consent from the user.
The Service account authorization is used to authenticate as a robot service account or to access resources on behalf of Google Workspace or Cloud Identity users through domain-wide delegation. A service account is a special kind of account used by an application rather than a person. Read more here.
Create a new authorization
To create a new authorization, do the following:
- Select the Authorization type in the respective dropdown.
- Click the Select authorization in current step button.
- Click the Gear button, then Add, or select to Create new authorization in the dropdown.
- A modal window for creating a new authorization will pop up. Follow the instructions in the modal's collapsible. When finished, the created Authorization name will be added to the list in the dropdown.
- Select respective Authorization name in the Select authorization in current step dropdown.
Select authorization in current step
The Select authorization in current step dropdown lists every authorization added to your OneReach.ai account.
- To choose an authorization, select its name in the dropdown.
The gear button contains options to Add a new or Delete an existing authorization, as well as to Refresh the list of added authorizations.
Click Edit to update the Service account authorization fields. You can also Reauthorize an OAuth 2.0 authorization.
Warning! If an external app was created in the OAuth Consent Screen, you need to reauthorize the created authorization in all Flows once approximately every 7 days.
Inherit from previous step
When you add a Step from the Google Drive/Calendar toolkit to the Flow, you are expected to manually choose the Authorization type and then an authorization from the respective dropdowns. If you add another Step from these toolkits to the Flow and their selected authorization types match, the option to Inherit from previous step is chosen by default. When selected, it continues to use the same authorization defined in the previous Step of the Google Drive/Calendar toolkit without needing to select it manually.
Warning! If the Inherit from previous step option is selected, but there is no Step with the matching Authorization type in the Flow, the Step results in an error.
Search settings
To set up this section, take the following steps:
- Provide the Item name that should be matched.
- Choose the Location on Google Drive where to list the data from.
- Define whether to Search for files, folders or both. If the Files option is selected, the File type dropdown becomes available.
- Optional: specify the file types of the searched files.
- Select whether to list All matches or Only the first match.
Item name
The Item name input must exactly match the name of the folder or the file to be listed.
Note: To find any file, include its extension in the Item name input. To find all items, leave the field empty.
Location
By default, the Step lists the matching items stored in All folders of the connected Google Drive account. To list data from a Specific folder, select that option, then provide the Folder ID value. Folder ID is a unique identifier of an existing folder in a Google Drive account.
Note: You can extract Folder ID as a Merge field value with the help of List Items in Folder (Google Drive) or another Find Items (Google Drive) Steps.
Caution: Google Drive does not differenciate items in its Trash from other items. Therefore, if an item from the specified location that matches the search parameters has been placed in the Trash of the connected Drive, the Step adds it to its output.
File type
By default, the Step returns all file types that match the search query. The File type dropdown lists the most commonly used file types. To return specific file types, select them from the list.
Note: You can use the
mimeType
property of a List Items in Folder (Google Drive) Step to define the file types via the Merge field.
Conflict handling
By default, if no items that match the search parameters are stored in the defined folder, or the Step cannot find the folder, the Flow proceeds down the not found
exit. The latter can happen when the folder has been deleted or the defined Folder ID is not valid. An option to Select the exit in case no item or folder is found allows you to take the Flow down the next
or error
exit.
Caution: The Step removes the
not found
exit if you select a different option.
Merge field settings
The Step stores the output data in a JSON object under the name provided in the Merge field name. To learn more about Merge fields, their types, and how to work with them, follow this link.
Output example
The output data includes the following properties:
Key | Type | Description |
---|---|---|
items | array | An array of objects, each includes the id , name , mimeType and parents properties of the item that matched the search parameters. |
id | string | The Folder ID or File ID of an item. |
name | string | The Folder name or File name of an item. |
mimeType | string | The File type of an item. |
parents | array | And array containing the Folder ID value of the folder to which the respective item belongs. |
See below an example of the Merge field object's structure:
{
"items": [{
"id": "",
"name": "",
"mimeType": "",
"parents": []
},...]
}
{
"items": [{
"id": "",
"name": "",
"mimeType": "",
"parents": []
},...]
}
The output data changes depending on the selected exit in case the item or folder is not found:
next
-{}
not found
-null
Error handling
By default, the Step handles errors using a separate exit. If an error occurs during the Step execution (e.g., if the authorization data is invalid), the Flow proceeds down the error
exit. For more information on error handling, follow this link.
Reporting
The Step automatically generates Reporting events during its execution, allowing for real-time tracking and analysis of its performance and user interactions. To learn more about Reporting events, follow this link.
Services dependencies
- studio v3.20.0
- authorization Manager v1.3.1
Release notes
v1.0.0
- Initial release