4 min read

getUserProfile Documentation

Purpose

The node is designed to retrieve user profile information from a Slack workspace based on a specified user ID. This integration allows users to access and manipulate user data efficiently within the context of the broader Vantage platform, enabling enhanced analytics and user management capabilities.

Settings

The following settings are integral to the node.

1. inputs.userId

2. config.userId

3. context

4. Error Handling

How It Works

  1. Connection Initialization: The function begins by executing the integration connection to establish a connection to Slack, using the provided context. This effectively initializes the necessary credentials and session for interacting with the Slack API.

  2. User Profile Retrieval: After establishing the connection, the function attempts to fetch the user profile by calling the getUserProfile method from the integration object, passing in the identified user ID (inputs.userId or config.userId).

  3. Error Management: In case of an error during this process, the function catches that error and returns a structured object containing an error message. This prevents crashing and provides feedback for debugging.

  4. Return Output: Upon successful retrieval, the user profile data is returned in an object under the key output1, making it accessible for further processing or display within the Vantage platform.

Expected Data

The node expects specific data to execute successfully:

Use Cases & Examples

Use Case 1: User Management in a Team Dashboard

A project management team may want to display user profiles on a dashboard, allowing team leads to see specific details about team members, such as their names, roles, and contact information directly from Slack.

Use Case 2: Integrating Slack User Data into Employee Performance Reviews

An HR team can leverage the node to pull user data from Slack for employee performance review sessions, helping managers to make informed assessments based on user interactions and feedback.

Configuration Example

To configure the node for retrieving user data for a team dashboard, the configuration data might look as follows:

json
{
  "inputs": {
    "userId": "U123456789"
  },
  "config": {
    "userId": "U987654321" // This acts as a fallback
  },
  "context": {
    "userToken": "xoxb-1234567890-0987654321-ABCDEFGHIJK"
  }
}

Explanation

In this configuration:

This configuration allows the dashboard to dynamically pull user data from Slack, enabling real-time updates and improved team visibility.