How to: Get Salesforce Contact Records

Overview

The Integration Gateway accelerates digital transformations by easily integrating with over 700 systems across enterprise applications and databases, including DocuSign, Jira, and SendGrid. This how-to guide provides you with an example for searching for and retrieving contact information from your Salesforce account using Unqork's Integration Gateway.

To learn more about Unqork's Integration Gateway and how to access it, view our Integration Administration article.

What You'll Learn

In this article, you'll learn how to create a recipe, connection, and endpoint to retrieve Salesforce contact information using Unqork's Integration Gateway.

Setting Up an Integration Using Integration Gateway

Before we begin, let's review the necessary steps to set up a Salesforce integration and make an API APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. call using the Integration Gateway.

1. Create a connection: First, you must connect to your Salesforce account to make any API calls using Unqork. This also requires you to have a Salesforce account and authorization credentials.
2. Create a recipe: Recipes are workflow-like steps the integration follows to perform actions. Recipes have many advanced features. They can handle all app integrations and workflow automation scenarios, including conditional triggers, actions, and so on.
3. Define an endpoint for a recipe: To make an API call to Salesforce in your Unqork applications, you must establish an endpoint. You'll use this endpoint to make the call in a Plug-In component.
4. Configure a Plug-In component: Set up a Plug-In component to call your recipe's endpoint and retrieve Salesforce contact information.

What You Need

Preconfiguration

The first step when creating your Salesforce recipe is configuring the Salesforce connection in the Integration Gateway.

You must have a Salesforce account to create these connections.

Configure Your Salesforce Connection

First, let's access Unqork's Integration Administration to configure connections using the Integration Gateway.

To access the Integration Administration page:

1. At the top right of the Unqork Designer Platform, click Settings ▾.
2. Click Administration.
3. Under Integration, select Integration Administration.

Now, let's use the Integration Gateway to create a Salesforce connection.

1. Open your Integration Gateway project.
2. Click Create ▾.
3. Select Connection.
4. Search for and select the  Salesforce connection tile.

A static image displaying the Create drop-down to select a new connection.

5. In the Connection Name* field, enter a name for your connection.

It's best practice to create a name that clearly defines the connection's purpose.

6. From the Auth Type* drop-down, select an authentication type.

By default, OAuth 2.0 is selected.

A static image displaying the creation of the Salesforce connection.

7. Click Connect. A modal A modal is a window that appears on top of the content you are currently viewing. displays for you to add your Salesforce credentials to complete the connection.
8. In the Username and Password fields, enter your Salesforce credentials.
9. Click Log In.

Your connection is now established and active for use in your recipe. Next, you'll review how to create your recipe.

Configure Your Get Salesforce Contact Records Recipe

Recipes let you integrate your connections, set up triggers, and determine the actions and events you want to occur. For this how-to guide, you'll configure a recipe to retrieve specified contact information from Salesforce.

To create a recipe and designate a starting point:

1. Open the Unqork project.
2. Click Create ▾.
3. Select Recipe.

A static image displaying the Create drop-down to select a new recipe

Configure a Starting Point

First, you need to configure the starting point, or trigger, for your recipe. With the recipe page now open, configure the following fields:

1. In the Name field, enter a name for your recipe.
2. From the Pick a Starting Point* section, select  Build an API Endpoint.

You must create an API endpoint recipe or the integration will not be available in Unqork.

A static image displaying the creation of the Get Salesforce Contact Records recipe.

3. Click Start Building.

You can then navigate to the Recipe Builder to finish setting up your starting point. The last step of this process is to select a response status code.

1. In the Setup panel to the right of the Recipe Builder, scroll down to the final Responses* sub-panel.
2. Click Add Response.
3. In the Name field, enter the message that displays for a successful API response.
4. From the HTTP Status Code drop-down, select 200 - OK.

You can create as many status codes and display messages as you wish. These status codes make it easier for users to identify when an issue occurs.

5. At the top of the panel, click Save.

Configure an Action

Next, configure an action that connects to your Salesforce account so you can retrieve a list of contact records, or submissions, based on specific fields.

To create an action:

1. Below your starting point, or trigger, click the button.
2. Select  Action in an App. A panel displaying all your connected apps displays to the right of the page.
3. Search for and select the  Salesforce tile.
4. Search for and select the Search Records tile.
5. Select the Salesforce Connection you made earlier.

6. From the Search for drop-down, select Contact. A list of fields (or inputs) populate, so you can hard-code values in your action.
7. From the Fields to Retrieve drop-down, select Contact ID, Last Name, and First Name.

Leave the Limit set as 150. The limit is the maximum number of records returned.

A static image displaying the Salesforce Contact fields to search by in the Integrations Gateway Action.

8. At the top of the panel, click Save.
9. At the top right of the panel, click x Exit.
10. Click Start Recipe.

Your recipe is now running and ready for use in Unqork. The final step to complete in the Integration Gateway is to create an endpoint for your recipe.

Configure Your Endpoint

In order to use your recipe in a Plug-In component, you must create an endpoint in the Integration Gateway. Once created, it displays in the component's External Services drop-down.

To configure your endpoint:

1. At the top left of the Recipe Builder, click the API Platform tab.
2. From the API Collections panel, select the Unqork Gateway collection tile.
3. Click + New Endpoint. A modal A modal is a window that appears on top of the content you are currently viewing. displays to configure your new endpoint.
4. In the Endpoint Name* field, enter a name for this endpoint.

It's best practice to create a unique name that defines your endpoint.

5. From the Recipe* drop-down, select your recipe.
6. In the Endpoint Path* field, enter a unique path for your endpoint. For example, getSalesforceContact.
7. From the HTTP Method* drop-down, select the method to use for this endpoint. In this case, leave it as the default GET to retrieve Salesforce contact information.

A static image displaying the Add New Endpoint modal with it's completed fields to get Salesforce contact information in Unqork.

8. Click Add Endpoint. You return to the API Platform page and your new endpoint tile displays at the top of the page.
9. On your endpoint tile, set the Active toggle to (ON).

You endpoint is now active. You can select it in a Plug-In component.

Configuration

The last step of the process is to configure a module to retrieve the contact data from Salesforce and populate a dashboard. These instructions assume you have a module saved with a title.

Configure the Plug-In Component

Add a Plug-In component to use your new Integration Gateway endpoint and retrieve a list of contacts from your Salesforce account.

1. In the Module Builder, drag and drop a Plug-In component onto your canvas.
2. In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. and Canvas Label Text Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. fields, enter plugGetSalesforceContacts.
3. To the left of the component's configuration window, click Data Icon Data.
4. Set External as the Service Type.
5. From the External Services drop-down, select the endpoint you created.

On selection, the Data Source URL and Request Type automatically populate.

A static image displaying the Plug-In component's configuration window with the selected Get Salesforce Contacts endpoint.

6. Click Save & Close.

Configure the Button Component

Next, add a Button component to trigger the Plug-In component.

1. Drag and drop a Button component Icon Button component onto the canvas, placing it below your Plug-In component.
2. In the Property ID A Property ID is the unique field ID used by Unqork to track and link components in your module. field, enter btnGetSalesforceContacts.
3. In the Canvas Label Text Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. field, enter Get Salesforce Contacts.
4. Set Event as the Action Type.
5. Click Save & Close.

Configure the ViewGrid Component

Lastly, let's configure a ViewGrid component to view the list of contact records based on the specified fields in our recipe.

1. Drag and drop a Dropdown Component Icon ViewGrid component onto the canvas, placing it below your Button component Icon Button component.
2. In the Label Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. and Property Name A Property ID is the unique field ID used by Unqork to track and link components in your module. fields, enter vgContactRecords.
3. In the Action field, enter null.
4. In the Inputs table, enter the following:
id Required

plugGetSalesforceContacts

(clear)

5. In the Display table, enter the following:
id Formula Heading

contactId

 

Contact ID

firstName

 

First Name

lastName

 

Last Name

Use the DevTools Console The DevTools Console helps you securely store, build, test, and deploy your software. to confirm correct mapping based on your Salesforce data structure.

A static image displaying the ViewGrid component's configuration window with the necessary Salesforce output IDs to display the data in a dashboard.

6. Click Save.
7. Save your module.

Now, Preview your module in Express View Express View is how your end-user views you application. Express View also lets you preview your applications to test your configuration and view the styling. This is also the view your end-users will see when interacting with your application. After configuring a module, click Preview in the Module Builder to interact with the module in Express View.. Click the button and view the retrieved contact records by contact ID and first and last name.