> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Zapier Searches

> Complete guide to Zapier searches for finding and retrieving specific data from Opigno Enterprise LIP

## What are Zapier Searches?

Zapier **searches** allow you to find and retrieve specific data from your Opigno Enterprise LIP. They're used to look up existing records, validate data, or find information needed for your automation workflows.

<Info>
  Searches are essential for preventing duplicate data, validating user information, and retrieving context needed for other actions in your Zaps.
</Info>

## Available Searches

The Opigno Enterprise Zapier integration provides 2 searches that allow you to retrieve specific training progress information from your learning management system. All searches use GraphQL queries to fetch data and provide structured results for automation workflows.

### Training Progress Searches

#### Get Score of User for Training

**Search Key**: `get_score_of_user_for_training_search`\
**Description**: Retrieves the score achieved by a user for a specific training/learning path.

<AccordionGroup>
  <Accordion title="GraphQL Query">
    This search uses the `learningPath` query which fetches:

    * **Learning Path Data**: Training ID and training details
    * **Attempt Metrics**: User's attempt data including global score
    * **Training Information**: Complete training metadata
  </Accordion>

  <Accordion title="Required Input Parameters">
    * **client\_uuid** (string, required): The user context UUID that uniquely identifies the user in Opigno Enterprise (equivalent to `user_id` in actions). This UUID must be created using the `setUserContext` mutation and passed in API requests via the `Opigno-Client-UUID` header. Learn more about [User Context Management](/OpignoEnterpriseAPI/UserContextManagement).
    * **training\_id** (string, required): The unique identifier of the training/learning path to get the score for. This is the Learning Path ID that can be obtained from the [Catalog](/OpignoEnterpriseAPI/RetrieveCatalog) or [My Learning](/OpignoEnterpriseAPI/MyLearningPage) queries. See [Learning Path](/OpignoEnterpriseAPI/LearningPath) for more details.
  </Accordion>

  <Accordion title="Returned Data">
    * **id** (integer): Training ID that was queried
    * **score** (integer): The user's global score for the training (0 if no score available)
  </Accordion>

  <Accordion title="Use Cases">
    * **Progress Tracking**: Monitor user performance on specific trainings
    * **Performance Analytics**: Generate reports on training effectiveness
    * **Conditional Logic**: Trigger different actions based on score thresholds
    * **Compliance Monitoring**: Track completion scores for mandatory training
  </Accordion>
</AccordionGroup>

#### Get Status of User for Training

**Search Key**: `get_status_of_user_for_training_search`\
**Description**: Retrieves the current status of a user's progress on a specific training/learning path.

<AccordionGroup>
  <Accordion title="GraphQL Query">
    This search uses the `learningPath` query which fetches:

    * **Learning Path Data**: Training ID and training details
    * **Attempt Metrics**: User's attempt data including completion status
    * **Training Information**: Complete training metadata
  </Accordion>

  <Accordion title="Required Input Parameters">
    * **client\_uuid** (string, required): The user context UUID that uniquely identifies the user in Opigno Enterprise (equivalent to `user_id` in actions). This UUID must be created using the `setUserContext` mutation and passed in API requests via the `Opigno-Client-UUID` header. Learn more about [User Context Management](/OpignoEnterpriseAPI/UserContextManagement).
    * **training\_id** (string, required): The unique identifier of the training/learning path to get the status for. This is the Learning Path ID that can be obtained from the [Catalog](/OpignoEnterpriseAPI/RetrieveCatalog) or [My Learning](/OpignoEnterpriseAPI/MyLearningPage) queries. See [Learning Path](/OpignoEnterpriseAPI/LearningPath) for more details.
  </Accordion>

  <Accordion title="Returned Data">
    * **id** (integer): Training ID that was queried
    * **status** (string): The user's current status for the training (e.g., 'COMPLETED', 'NOT\_STARTED', 'IN\_PROGRESS')
  </Accordion>

  <Accordion title="Use Cases">
    * **Progress Monitoring**: Check if users have started or completed training
    * **Workflow Automation**: Trigger different actions based on completion status
    * **Compliance Reporting**: Track mandatory training completion status
    * **User Management**: Identify users who need to complete specific training
  </Accordion>
</AccordionGroup>

## Setting Up Searches

All Opigno Enterprise searches use GraphQL queries to retrieve specific training progress data. Each search requires specific input parameters and returns structured data for automation workflows.

<Steps>
  <Step title="Choose Your Search Type">
    1. In Zapier, select **Opigno Enterprise** as your search app
    2. Choose from the 2 available searches based on your data needs:
       * **Get Score of User for Training**: Retrieve user's score for a specific training
       * **Get Status of User for Training**: Retrieve user's completion status for a specific training
    3. Review the search description and data structure
  </Step>

  <Step title="Configure Authentication">
    1. Connect your Opigno Enterprise account using your API credentials
    2. Ensure your API user has appropriate permissions to access training progress data
    3. Test the connection to verify authentication works correctly
  </Step>

  <Step title="Set Up Search Parameters">
    Both searches require the same input parameters:

    **Required Parameters**:

    * **client\_uuid** (string): The UUID of the user whose data you want to retrieve
    * **training\_id** (string): The ID of the training/learning path to query

    **Parameter Mapping**:

    * Map data from previous Zap steps to these required parameters
    * Ensure the client\_uuid corresponds to a valid user in your Opigno instance
    * Verify the training\_id exists and is accessible to the user
  </Step>

  <Step title="Handle Search Results">
    1. Both searches return structured data with training ID and either score or status
    2. Set up conditional logic based on the returned values:
       * **Score Search**: Use score values for performance-based automation
       * **Status Search**: Use status values for completion-based workflows
    3. Configure fallback actions for cases where no data is found
    4. Map search results to subsequent Zap steps
  </Step>

  <Step title="Test Your Search">
    1. Use Zapier's test feature with valid user UUIDs and training IDs
    2. Verify that results match your expectations
    3. Test with different users and trainings to ensure reliability
    4. Check error handling for invalid parameters
  </Step>
</Steps>

## Performance Optimization

### Search Efficiency

* **Parameter Validation**: Always validate client\_uuid and training\_id before making requests
* **Error Handling**: Implement proper error handling for GraphQL query failures
* **Result Processing**: Handle default values appropriately (score = 0, status = 'NOT\_STARTED')
* **Conditional Logic**: Use search results to drive conditional workflows efficiently

### API Usage Management

* **GraphQL Queries**: Both searches use the same `learningPath` query with different response mapping
* **Error Handling**: Searches throw descriptive errors when GraphQL queries fail
* **Parameter Mapping**: Ensure proper mapping of input parameters to GraphQL variables
* **Result Validation**: Validate search results before using them in subsequent steps

## Troubleshooting Searches

<AccordionGroup>
  <Accordion title="Search Not Returning Expected Data">
    **Common causes:**

    * Invalid client\_uuid parameter (user doesn't exist)
    * Invalid training\_id parameter (training doesn't exist)
    * User doesn't have access to the specified training
    * Training hasn't been started (returns default values)

    **Solutions:**

    * Verify client\_uuid corresponds to a valid user in Opigno
    * Check that training\_id exists and is accessible
    * Ensure user has proper permissions for the training
    * Handle default values appropriately (score = 0, status = 'NOT\_STARTED')
  </Accordion>

  <Accordion title="GraphQL Query Errors">
    **Common causes:**

    * Invalid training\_id format or value
    * Insufficient API permissions
    * Opigno instance configuration issues
    * Network connectivity problems

    **Solutions:**

    * Validate training\_id format before making requests
    * Ensure API user has appropriate permissions
    * Test GraphQL queries directly against Opigno API
    * Check Opigno instance logs for detailed error messages
    * Implement proper retry logic for transient failures
  </Accordion>

  <Accordion title="Unexpected Search Results">
    **Common scenarios:**

    * Score returns 0 when user hasn't started training
    * Status returns 'NOT\_STARTED' for new assignments
    * Training ID doesn't match expected training

    **Solutions:**

    * Check for default values in search results
    * Verify training\_id mapping is correct
    * Implement conditional logic for different result scenarios
    * Log search parameters and results for debugging
  </Accordion>
</AccordionGroup>

## Next Steps

Continue building your automation workflows:

<CardGroup cols={2}>
  <Card title="Zapier Triggers" icon="zap" href="/zapier-integration/components/triggers">
    Learn how to set up automated triggers for your workflows.
  </Card>

  <Card title="Zapier Actions" icon="play" href="/zapier-integration/components/actions">
    Discover how to configure actions that respond to your triggers.
  </Card>
</CardGroup>
