Skip to content

Search (Salesforce) v4.0.7 Help

Searches for records in Salesforce that match filter criteria.

How can I use the Step?

You can use the Step to find specific records that match your search criteria across all objects in Salesforce. The Step lets you filter through large amounts of data and retrieve only the relevant information.

How does the Step work?

You authorize the Step and specify the object name and conditions for searching records. The Step takes these inputs and requests the Salesforce API to fetch the matching records (see Output example).

Prerequisites

Before you get started, you must do the following:

  • Obtain the Consumer Key and Consumer Secret of the Salesforce Connected App you want to authorize the Step with. For more information about creating and configuring a Connected App, see Create a Connected App documentation.

Authorization

To authorize the Step, you can inherit authorization from a previous Step, select existing authorization or create a new one.

Here are the steps to create a new Salesforce authorization:

  1. For Select authorization in the current Step, choose the Create a new authorization option from the dropdown.

  2. In the Add an authorization popup, do the following:

    • For Your Connected Apps, select an existing Connected App or click Add a new Connected App and provide the required details in a popup:

      • Name this Connected App: Connected App name.
      • Environment: Environment choice for the Connected App in Salesforce. Either production or sandbox.
      • Consumer Key: Consumer Key for Connected App in Salesforce (see Prerequisites).
      • Consumer Secret: Consumer Secret for Connected App in Salesforce (see Prerequisites).
      • Callback URL: OAuth 2.0 redirect URL. You must use it as Callback URL when creating Connected App on Salesforce.
    • Name your new authorization.

    • Choose where to save the authorization.

    • Authorize the Step by clicking Authorize now or pasting the authorization URL into a web browser.

Once the Step is authorized, all related settings are automatically updated, and you can continue with the Step settings.

Search settings

To set up this section, follow these steps:

  1. For Object type, select the object type you want to search. After authorizing the Step, the list of available object types is automatically loaded.
  2. For Conditions, add rules for searching records and provide a description.
  3. Optional: Turn on Fetch all records of the selected object type to fetch all records instead of querying records with some conditions.
  4. Optional: Turn on Fetch deleted items to include deleted items in the response.

Output Data

Select which object fields you want to receive in response.

The Step always outputs the object ID, URL, and type. To add other fields in the response, use the Object fields list. Alternatively, switch on the Add all the fields to add all the object fields to the Step response.

Advanced Settings

You can use this section to configure the following parameters:

  • SOSL query: A SOSL (Salesforce Object Search Language) query to search for text in your organization's records. Use it instead of specifying search parameters in Conditions. To learn more about SOSL queries, see the Salesforce SOSL documentation.

  • API version: The Salesforce API version for requests. The value must be in the format 50 or 50.0 and contain at least two characters. The default API version is 50, and the minimum supported version is 21.

Merge field settings

The Step returns the result as a JSON object and stores it in the Merge field variable. So you can use the retrieved data in subsequent Steps or other Flows.

Output example

The output includes records matching provided search parameters.

For example, if you query the "Account" object and receive some matches, the response might look like this:

json
{
    "matches": [
        {
            "Id": "001R0000003dHwKIAU",
            "Name": "Acme Corporation",
            "Type": "Prospect",
            "Phone": "(415) 555-1212",
            "Website": "http://www.example.com",
            "BillingCity": "San Francisco",
            "BillingState": "CA",
            "BillingPostalCode": "94105",
            "BillingCountry": "USA",
            "OwnerId": "005R0000000ABCD1234",
            "CreatedDate": "2022-03-22T21:45:18.000+0000",
            "LastModifiedDate": "2022-03-22T21:45:18.000+0000"
        },
        ...
    ]
}
{
    "matches": [
        {
            "Id": "001R0000003dHwKIAU",
            "Name": "Acme Corporation",
            "Type": "Prospect",
            "Phone": "(415) 555-1212",
            "Website": "http://www.example.com",
            "BillingCity": "San Francisco",
            "BillingState": "CA",
            "BillingPostalCode": "94105",
            "BillingCountry": "USA",
            "OwnerId": "005R0000000ABCD1234",
            "CreatedDate": "2022-03-22T21:45:18.000+0000",
            "LastModifiedDate": "2022-03-22T21:45:18.000+0000"
        },
        ...
    ]
}

Error Handling

By default, the Handle error toggle is on, and the Step handles errors with a separate exit. If any error occurs during the Step execution, the Flow proceeds down the error exit.

If the Handle error toggle is disabled, the Step does not handle errors. In this case, if any error occurs during the Step execution, the Flow fails immediately after exceeding the Flow timeout. To prevent the Flow from being suspended and continue handling errors, you can place the Flow Error Handling Step before the main logic or your Flow.

Reporting

After the Step completes, it generates a report that includes its execution status and other details. You can customize the report by adjusting the Step's log level and adding tags.

Log level

By default, the Step's log level matches that of the Flow. You can change the Step's log level by selecting an appropriate option from the Log level dropdown.

Tags

Tags provide a way to classify and search for sessions based on their attributes. To create a new tag, specify its category, label, and value. You can then use tags to filter and group the sessions in the report.

Service dependencies

  • flow builder v2.28.3
  • event-manager v2.3.0
  • deployer v2.6.0
  • library v2.11.3
  • studio v2.64.1
  • authorizer 2 service v2.1.6
  • salesforce data provider

Release notes

v4.0.7

  • Add API version selection to the Step UI

v4.0.5

  • Add an ability to get default options for the Object type field and the default list of fields for the selected object type through the provider when using dynamic collection authorization.

v4.0.4

  • Fix validation for search parameters
  • Add option to search in deleted items
  • Fix UI style
  • Replace text input to code input for the SOSL Query field.

v4.0.3

  • Update Authorization Manager v1.2.10

v4.0.2

  • Remove extra data
  • Fix condition-builder validation

v4.0.1

  • Implemented Authorization Manager v1.1.0,
  • Add Step migration

v4.0.0

  • Update condition builder
  • Change Step ID

v3.0.8

  • Update Authorization Manager settings

v3.0.6

  • Add search by OR/AND params and SOSL query
  • Add data output handler
  • Add a search option for all records of the selected object type

v3.0.4

  • Update Authorization Manager v1.0.5
  • Add dynamic instance_url

v3.0.3

  • Update Authorization Manager v1.0.4

v3.0.1

  • Update the toJSON function and wildcard logic with the new Merge field expression template