Search Automation
This will automatically do the entire pagination logic and will output a nice 'flat' list of records.
Last updated
This will automatically do the entire pagination logic and will output a nice 'flat' list of records.
Last updated
The remote search feature allows users to search for IDs by a name they're used to, e.g. they can search for a contact ID by the name of a contact:
To implement this feature, the following configurations are required:
Connector configuration: Defines how the search is performed.
Pagination configuration (if needed): Handles cases where results span multiple pages.
UI form schema: Specifies where and how the search input appears in the user interface.
The connector's configuration is provided in JSON format, which defines the logic and parameters for the search operation.
The search configuration defines most of the logic required to execute a search. It specifies the fields to retrieve, query structure, endpoint, and optional parameters like body and conditions. You can use Jinja in all fields to use parameters passed from the action or even have conditional statements
Key Fields:
response_fields
:
A dictionary specifying JSON paths for search results.
id
: JSON path for the field to insert into the connector (typically an ID).
$[*].id
retrieves the contact ID field (example above)
match
: JSON path for the field used in user search (e.g., name).
$[*].name
retrieves the contact's name (example above)
endpoint
:
The endpoint
is the endpoint that is used for searching by that connector and will be appended to the base domain, just like the endpoint in actions.
body
(optional)
A JSON string for request body parameters in a POST request.
type
:
Specifies the search type:
search
: Uses the connector's search endpoint directly.
list
: Retrieves a list of entities when the connector lacks a search endpoint. In this case, the actual search happens in our backend.
when
(optional)
A condition evaluated as True
to determine if this configuration should be used.
This needs to be used in combination with multiple configurations.
To support multiple search scenarios for one Connector, the configuration needs to be a list of configurations, and the parameter when
needs to be used, except for the last statement, which can be a 'catch all' configuration.
The when
parameter will be checked from top to bottom and the one that matches first will be used. In case none match and a search configuration does not have a when
parameter, that configuration will be used (i.e. similar to multiple elif
and lastly an else
statement)
This is only needed in case there's any pagination for the endpoint required. Parameters such as limit
can be directly configured within the search configuration.
The pagination configuration is also used for Automatic Pagination Configuration
On the action that uses the search some more configurations are necessary, in order to specify in which field the search should happen and to pass further parameters.
The field used for search needs to be on the first level of JSON nesting (i.e. it can't be nested).
type
The type of the field has to be text
We didn't see a use case for any other field type, so we kept it simple. In case you see a use case, let us know.
placeholder
(optional)The placeholder
is not required, however, this is probably the best way to make it obvious to the user that they can search here.
hasRemoteSearch
hasRemoteSearch
needs to be set to true
.
resourceType
resourceType
is required to be filled and will be accessible in the search configuration.
This could e.g. be "customer", "ticket", "user"; so an entity name that exists in the connector.
remoteSearchParam
With this field, we can use input from other fields, which are also on the first level of JSON nesting and then access it within the search configuration
E.g. for Asana, we need to pass the workspace_gid
to the search configuration, which looks like this:
The UI Form Schema in this case would look something like this:
count
(optional)This could e.g. be 5
or 10
; and specifies the number of entities that we want to return (in case this is configured in the search configuration).
We haven't seen a use case yet where it makes sense to configure this on the action. If we don't see one in the next month, we can probably remove it entirely
HubSpot has a search endpoint, which works great for the resource types that could have potentially thousands of entries (i.e. using type list is not an option), however, it does not work for all resource types and for the ones that are not supported get calls need to be made.
Thus, multiple configurations are needed in order to cover all resource types:
For the search endpoint HubSpot expects a POST
request, thus we need to provide the field body
instead of the field query
.
This configuration will use the when
parameter, as HubSpot has a set list of resource types that are supported by this endpoint.
For the get endpoints, search type list
needs to be used.
Here, the when
parameter will not be used, as it should always be used if the resource type is not supported by the search endpoint (and thus the first search configuration).
This is not dynamic yet, needs to be improved
Here we use conditional Jinja logic in order to reference to the proper match
field.