List Users
Definition
The List Users
action retrieves a list of users from your Asana account. This allows you to programmatically access user information based on their association with specific workspaces or teams, or simply fetch all users in the organization.
- Key capabilities:
- Retrieve a comprehensive list of all users in your Asana instance.
- Filter and list users belonging to a specific workspace.
- Filter and list users who are members of a specific team.
This action is fundamental for automating user management, task assignment, and reporting workflows by providing the necessary user data to other actions in your flow.
Inputs
-
Connection
- Purpose: This field establishes a secure, authenticated connection to your Asana account.
- Practical Guidance: You must select a pre-configured Asana connection or create a new one. This is a mandatory first step that authorizes zenphi to access the user data from your Asana instance. This is always a static value selected from the dropdown.
- Use Case Context: You would use this field to tell zenphi which specific Asana account it should retrieve users from.
-
Get
- Purpose: This field allows you to define the scope of your user search.
- Practical Guidance: This is a dropdown menu where you select how you want to filter the users. Your selection here will determine which other input fields become available. For example, selecting 'Users by Team' will show both the 'Workspace' and 'Team' fields.
- Use Case Context: You would use this field to specify whether you need every user in the company or just the members of a particular project team.
- 2.1. All Users: Retrieves every user in the connected Asana account.
- 2.2. Users by Workspace: Retrieves only the users who are members of a specific workspace.
- Workspace
- Purpose: This field specifies the exact workspace from which to retrieve users.
- Practical Guidance: After your connection is established, you can select the desired workspace from a dropdown list of all available workspaces. Alternatively, you can provide a dynamic value by using the token picker to insert a Workspace ID from a previous step in your flow (e.g., from a 'Get Workspace' action).
- Use Case Context: You would use the 'Workspace' field to get all users associated with the "Marketing Campaigns" workspace.
- Workspace
- 2.3. Users by Team: Retrieves only the users who are members of a specific team.
- Workspace
- Purpose: This field specifies the workspace that contains the team you want to query.
- Practical Guidance: You must first select the parent workspace from the dropdown list or provide its ID dynamically using the token picker. This selection will then populate the 'Team' field with the relevant teams.
- Use Case Context: You would first select the "Product Development" workspace to then be able to select a team from within it.
- Team
- Purpose: This field specifies the exact team from which to retrieve users.
- Practical Guidance: Once a workspace is selected, you can choose the team from a dropdown list. You can also provide the Team ID dynamically using a token from a previous action.
- Use Case Context: You would use the 'Team' field to get a list of all members of the "Mobile App Developers" team.
- Workspace
Outputs
- users
- Data Description: This output is a list containing objects, where each object represents a single Asana user and their associated details.
- Workflow Utility: This list is extremely useful for iterative processes. You can pass this entire list to a 'For Each' loop to perform an action on every user, such as assigning them a standard onboarding task or adding them to a mailing list.
- Id
- Data Description: The globally unique identifier (GID) for the user in Asana.
- Workflow Utility: This ID is the most reliable way to reference a user. It is essential for subsequent actions like 'Assign Task' or 'Add Comment', as it ensures the action is performed on the correct user, even if their name changes.
- Name
- Data Description: The full name of the user as it appears in Asana.
- Workflow Utility: This is useful for creating human-readable outputs, such as personalizing an email notification, generating a report, or logging the flow's progress in a clear and understandable way.
- Email
- Data Description: The email address associated with the user's Asana account.
- Workflow Utility: This email is perfect for integrating with other services. You can use it in a 'Send Email' action to notify users directly or use it to look up the same user in another system like Google Workspace or Slack.
- Workspaces
- Data Description: A list of all workspaces that the user is a member of. Each item in this list contains the
Id
andName
of the workspace. - Workflow Utility: This is valuable for auditing and conditional logic. You can check if a user belongs to a specific workspace before proceeding with a workflow, ensuring that only relevant users are processed. For example, you could verify a user is in the "Finance" workspace before granting them access to a sensitive document.
- Data Description: A list of all workspaces that the user is a member of. Each item in this list contains the
Example Use Cases
- Generate Team Roster Reports Automatically fetch all members of a specific Asana team to populate a Google Sheet for auditing or contact list purposes.
- Automate Project Kick-off Tasks Retrieve all members of a project team to automatically assign them a standardized set of initial tasks when a new project begins.
- Synchronize User Directories List all users in an Asana workspace to ensure they are correctly provisioned in other systems, such as a corresponding Google Group or a CRM.
- Streamline User Offboarding Find a specific user's Asana ID based on their email to reassign all their open tasks as part of an automated offboarding process.
Example
Scenario: A project manager needs to ensure that every time a new "Quarterly Marketing Campaign" project is initiated, all members of the "Digital Marketing Team" are automatically assigned a standard "Review Campaign Brief" task. Manually assigning this task to each member is time-consuming and risks someone being missed.
Steps to Implement:
- Start the flow with a trigger, such as a zenphi Form submission titled "New Marketing Campaign" or a Google Form trigger.
- Configure the List Users action to get the team members.
- Connection: Select your pre-configured Asana connection.
- Get: Choose
Users by Team
from the dropdown. - Workspace: Select the "Marketing Department" workspace.
- Team: Select the "Digital Marketing Team".
- Add a For Each loop action immediately after the List Users action. In the
Items
field of the loop, insert theusers
token from the output of the List Users action. - Inside the For Each loop, add an Asana Create Task action.
- Assignee: Use the token picker to select the
Id
from the current item of the loop (For Each.item.Id
). - Task Name: Enter a static value like "Review Campaign Brief".
- Project: Select the new project that was created or referenced in the trigger step.
- Assignee: Use the token picker to select the
Outcome: The workflow is now fully automated. When a new campaign project is started, the flow instantly retrieves the current list of all members in the "Digital Marketing Team" and assigns each one the initial review task. This saves the project manager significant time, eliminates manual errors, and ensures every team member is included consistently.
Best Practices
- Filter for Performance Instead of always fetching "All Users," use the "Users by Workspace" or "Users by Team" filters whenever possible. This reduces the amount of data processed, making your flow faster and more efficient, especially in large organizations.
- Use the User ID for Reliability Always use the
Id
output token in subsequent actions like assigning tasks or adding comments. Usernames and emails can change, but the unique User ID provides a stable and error-proof reference to the correct user. - Account for Empty Lists After the
List Users
action, consider adding a condition to check if the returnedusers
list is empty before proceeding to a "For Each" loop. This prevents the flow from failing or behaving unexpectedly if no users are found in the specified team or workspace.
Updated about 10 hours ago