Salesforce Data Retrieval icon

Salesforce Data Retrieval

(0 reviews)

home

Illustrates how to build a simple HTTP application to query Salesforce dynamically. This example helps you create an HTTP request-response application to retrieve data from a Salesforce instance.

This example can also be used while configuring any of the Mule Anypoint Salesforce Templates for retrieving all needed Salesforce entity IDs, such as to select User as object, leave Field empty, and query by email.

Example

In this example, a user makes an HTTP request to the endpoint containing predefined set of parameters that are extracted and used while building a Salesforce query. Afterwards, the application receives the response and provides it to the end user.

Set Up and Run the Example

As with other examples, you can create template applications straight out of the box in Anypoint Studio. You can tweak the configurations of these use case-based examples to create your own customized applications in Mule.

Follow the procedure below to create, then run the Salesforce data retrieval application.

  1. Create the example application in Anypoint Studio or Standalone.
  2. Go to Global Elements and open Salesforce Connector element. Fill in your Salesforce credentials including the security token.
  3. Run the application.
  4. Open your browser to http://localhost:8081. The generated form contains:

    • Object - Specify Salesforce object type, such as User, Account, Contact, etc.
    • Field - A valid field name for the given object you need, such as Email for Contact. Important: ID and Name attributes are retrieved by default, so choosing these fields causes an invalid query.
    • Search Key - A valid field name to use for matching, such as a name of a contact.
    • Search Value - A value for the Search Key field to use for matching, such as young for Contact Name. All records that contain the Search Value value as a substring of the given Search Key field value are returned. For example, contacts with names such as John Young or Michael Young are returned. The more specific value, the less results you obtain.
  5. Click Submit button.
  6. You see the retrieved data structure.
  7. In case of invalid input, the message: Invalid Salesforce query.

If you are unsure about valid object types and their attributes, visit Salesforce Documentation site - Standard Objects.

Documentation

Read full documentation in GitHub


Reviews

TypeExample
OrganizationMulesoft Inc.
Published by
MuleSoft Organization
Published onMar 17, 2018
Asset overview

Asset versions for 1.4.x

Asset versions
VersionActions
1.4.0