---
availability: INSTALLABLE
description: A plugin that allows you to fetch everything you need about a lead on
  the fly, without switching tabs or digging through Salesforce.
installation_asset_uuid: c736a6a5-811d-4310-9f87-e6ddf789712e
name: Look Up a Lead
purple_chat_link: https://marketplace.moveworks.com/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43+AM%22%2C%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22I+want+to+view+information+for+a+lead.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Okay%2C+I+can+help+you+with+that.+Would+you+like+to+see+a+specific+lead%2C+leads+assigned+to+you%2C+or+leads+for+a+company%3F%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22leads+assigned+to+me%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Retrieving+leads+assigned+to+you+from+Salesforce.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Here+are+some+leads+assigned+to+you%3A%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3EJane+Doe%3C%2Fb%3E+%28Acme+Inc.%29%3C%2Fli%3E%3Cli%3E%3Cb%3EJohn+Smith%3C%2Fb%3E+%28Global+Corp%29%3C%2Fli%3E%3Cli%3E%3Cb%3EAlice+Brown%3C%2Fb%3E+%28Innovate+LLC%29%3C%2Fli%3E%3C%2Ful%3EWhich+lead+would+you+like+to+view+details+for%3F%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Jane+Doe%22%7D%2C%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22John+Smith%22%7D%2C%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Alice+Brown%22%7D%5D%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22John+Smith%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ERetrieving+details+of+John+Smith+lead+from+Salesforce%3C%2Fp%3E%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ERetrieving+tasks+and+events+for+John+Smith+from+Salesforce%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EHere+are+the+details+for+%3Cb%3EJohn+Smith%3C%2Fb%3E%3A%3C%2Fp%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3EName%3A%3C%2Fb%3E+John+Smith%3C%2Fli%3E%3Cli%3E%3Cb%3ECompany%3A%3C%2Fb%3E+Global+Corp%3C%2Fli%3E%3Cli%3E%3Cb%3EIndustry%3A%3C%2Fb%3E+Technology%3C%2Fli%3E%3Cli%3E%3Cb%3EEmail%3A%3C%2Fb%3E+john.smith%40globalcorp.com%3C%2Fli%3E%3Cli%3E%3Cb%3EPhone%3A%3C%2Fb%3E+%28555%29+123-4567%3C%2Fli%3E%3Cli%3E%3Cb%3EAddress%3A%3C%2Fb%3E+123+Main+St%2C+Anytown%2C+USA%3C%2Fli%3E%3Cli%3E%3Cb%3ELead+Status%3A%3C%2Fb%3E+Qualified%3C%2Fli%3E%3Cli%3E%3Cb%3ELead+Source%3A%3C%2Fb%3E+Website%3C%2Fli%3E%3Cli%3E%3Cb%3ECreated+Date%3A%3C%2Fb%3E+2023-01-15%3C%2Fli%3E%3Cli%3E%3Cb%3EOwner%3A%3C%2Fb%3E+Yourself%3C%2Fli%3E%3C%2Ful%3E%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cb%3EUpcoming+Tasks%3A%3C%2Fb%3E%3C%2Fp%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3EFollow+up+call+%28Due%3A+2023-11-20%29%3C%2Fli%3E%3Cli%3ESend+product+brochure+%28Due%3A+2023-11-22%29%3C%2Fli%3E%3C%2Ful%3E%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cb%3ERecent+Events%3A%3C%2Fb%3E%3C%2Fp%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3EInitial+Discovery+Call+%282023-11-15%29%3C%2Fli%3E%3Cli%3EProduct+Demo+%282023-11-10%29%3C%2Fli%3E%3C%2Ful%3E%22%7D%5D%7D%5D%7D
solution_tags:
- Productivity
- Sales
systems:
- salesforce
---

## **Introduction**

The **“Look Up a Lead”** plugin lets you instantly access all the information you need about your sales leads, right within the Moveworks AI Assistant. With this plugin, you can quickly pull up lead details without switching tabs or searching through Salesforce, saving time and keeping everything at your fingertips.

This guide will show you how to search for leads, filter results, and view complete lead information directly in Agent Studio. Let’s get started!

## **Prerequisites**

• Access to **Agent Studio**

## **What are we building?**

### **Agent Design**

This [purple chat](https://marketplace.moveworks.com/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43+AM%22%2C%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22I+want+to+view+information+for+a+lead.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Okay%2C+I+can+help+you+with+that.+Would+you+like+to+see+a+specific+lead%2C+leads+assigned+to+you%2C+or+leads+for+a+company%3F%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22leads+assigned+to+me%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Retrieving+leads+assigned+to+you+from+Salesforce.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Here+are+some+leads+assigned+to+you%3A%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3EJane+Doe%3C%2Fb%3E+%28Acme+Inc.%29%3C%2Fli%3E%3Cli%3E%3Cb%3EJohn+Smith%3C%2Fb%3E+%28Global+Corp%29%3C%2Fli%3E%3Cli%3E%3Cb%3EAlice+Brown%3C%2Fb%3E+%28Innovate+LLC%29%3C%2Fli%3E%3C%2Ful%3EWhich+lead+would+you+like+to+view+details+for%3F%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Jane+Doe%22%7D%2C%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22John+Smith%22%7D%2C%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Alice+Brown%22%7D%5D%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22John+Smith%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ERetrieving+details+of+John+Smith+lead+from+Salesforce%3C%2Fp%3E%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ERetrieving+tasks+and+events+for+John+Smith+from+Salesforce%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EHere+are+the+details+for+%3Cb%3EJohn+Smith%3C%2Fb%3E%3A%3C%2Fp%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3EName%3A%3C%2Fb%3E+John+Smith%3C%2Fli%3E%3Cli%3E%3Cb%3ECompany%3A%3C%2Fb%3E+Global+Corp%3C%2Fli%3E%3Cli%3E%3Cb%3EIndustry%3A%3C%2Fb%3E+Technology%3C%2Fli%3E%3Cli%3E%3Cb%3EEmail%3A%3C%2Fb%3E+john.smith%40globalcorp.com%3C%2Fli%3E%3Cli%3E%3Cb%3EPhone%3A%3C%2Fb%3E+%28555%29+123-4567%3C%2Fli%3E%3Cli%3E%3Cb%3EAddress%3A%3C%2Fb%3E+123+Main+St%2C+Anytown%2C+USA%3C%2Fli%3E%3Cli%3E%3Cb%3ELead+Status%3A%3C%2Fb%3E+Qualified%3C%2Fli%3E%3Cli%3E%3Cb%3ELead+Source%3A%3C%2Fb%3E+Website%3C%2Fli%3E%3Cli%3E%3Cb%3ECreated+Date%3A%3C%2Fb%3E+2023-01-15%3C%2Fli%3E%3Cli%3E%3Cb%3EOwner%3A%3C%2Fb%3E+Yourself%3C%2Fli%3E%3C%2Ful%3E%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cb%3EUpcoming+Tasks%3A%3C%2Fb%3E%3C%2Fp%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3EFollow+up+call+%28Due%3A+2023-11-20%29%3C%2Fli%3E%3Cli%3ESend+product+brochure+%28Due%3A+2023-11-22%29%3C%2Fli%3E%3C%2Ful%3E%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cb%3ERecent+Events%3A%3C%2Fb%3E%3C%2Fp%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3EInitial+Discovery+Call+%282023-11-15%29%3C%2Fli%3E%3Cli%3EProduct+Demo+%282023-11-10%29%3C%2Fli%3E%3C%2Ful%3E%22%7D%5D%7D%5D%7D) shows the experience we are going to build.

## **Installation Steps**

We recommend creating the connector for **Salesforce** first, prior to installing this plugin. Please follow the  [Salesforce Connector](https://marketplace.moveworks.com/connectors/salesforce#how-to-implement) guide to set up the connector.

**Object Access**:

- `Read` access to the **Lead** object

After you have configured the connector, Please refer to our [plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace-installation) for more details on how to install a plugin in Agent Studio.

## **Appendix**

### **API #1 : Get Leads by Name**

```bash
curl --location 'https://<your-instance>/services/data/vXX.X/query/?q=SELECT+Id%2CName%2CTitle%2CCompany%2CEmail%2COwner.Name%2CStatus%2CPhone%2CStreet%2CCity%2CState%2CPostalCode%2CCountry%2CLastModifiedDate+FROM+Lead+WHERE+Name+LIKE+%27%25{{name}}%25%27+AND+IsConverted%3Dfalse+ORDER+BY+LastModifiedDate+DESC+LIMIT+50' \
--header 'Authorization: Bearer <your-access-token>'
```

**Query Parameters**

- `name`  - Search for a specific lead by name.

### **API #2 : Get Leads by Owner's Email**

```bash
curl --location 'https://<your-instance>/services/data/vXX.X/query/?q=SELECT+Id%2C+Name%2C+Title%2C+Company%2C+Email%2C+Owner.Name%2C+Status%2C+Phone%2C+Street%2C+City%2C+State%2C+PostalCode%2C+Country%2C+LastModifiedDate+FROM+Lead+WHERE+Owner.Email%3D%27{{ownerEmail}}%27+AND+IsConverted%3Dfalse+ORDER+BY+LastModifiedDate+DESC' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-access-token>'
```

**Query Parameters**

- `ownerEmail` - Search by Lead Owner’s Email.

### **API #3 : Get Leads by Company**

```bash
curl --location 'https://<your-instance>/services/data/vXX.X/query/?q=SELECT+Id%2CName%2CTitle%2CCompany%2CEmail%2COwner.Name%2CStatus%2CPhone%2CStreet%2CCity%2CState%2CPostalCode%2CCountry%2CLastModifiedDate+FROM+Lead+WHERE+Company+LIKE+%27%25{{company}}%25%27+AND+IsConverted%3Dfalse+ORDER+BY+LastModifiedDate+DESC+LIMIT+50' \
--header 'Authorization: Bearer <your-access-token>'
```

**Query Parameters**

- `company` - Search by company name to retrieve lead details.

### **API #4 : Get Lead Details**

```bash
curl --location 'https://<your-instance>/services/data/vXX.X/query/?q=SELECT+Industry%2CLeadSource%2COwner.Email%2CLastActivityDate%2CLastModifiedDate%2C(SELECT+Id%2CSubject%2CActivityDate%2CStatus%2CTaskSubtype%2CCallType%2CDescription%2COwner.Name+FROM+Tasks)%2C(SELECT+Id%2CSubject%2CStartDateTime%2CEndDateTime%2CLocation%2CDescription%2COwner.Name+FROM+Events)+FROM+Lead+WHERE+Id%3D%27{{lead_data}}%27+ORDER+BY+LastModifiedDate+DESC+LIMIT+50' \
--header 'Authorization: Bearer <your-access-token> ' \
```

**Query Parameters**

- `lead_data` - Search by lead id to retrieve lead details.

