Overview
The SharpenDB SELECT panel executes a SELECT query against a custom table in SharpenDB and returns matching records for use within your Logic+ flow. Table schemas and data are fully customizable, allowing you to retrieve specific information to drive routing decisions, personalize interactions, or populate dynamic messaging for callers.
Relevant API documentation for configuring SharpenDB queries can be found at your isolation zone link: IZ0 or IZ1.
Before You Begin
Use the Test feature within the panel to validate that your query returns the expected records before your flow goes live. After testing, you can select specific property values directly from the response to automatically generate variables, saving you from configuring them by hand.
Example Use Case
A Logic+ flow handles inbound calls and needs to personalize the experience based on the caller's history. When the call arrives, the SharpenDB SELECT panel queries a custom customer table using the caller's ANI, retrieving their preferred language and account tier. Those values are stored in variables and used downstream to route the call to the appropriate queue and greet the caller in their preferred language.
Properties
-
Name
Enter a unique, descriptive name to identify the panel.
-
Description
Enter any notes about the panel for reference. This field is collapsed by default; select the down arrow to expand it.
-
Initiates Flow
Designates this panel as the starting point of the Logic flow. When selected, this panel will be the first to execute when the flow is triggered. This can only be removed by setting a different panel as the flow initiator.
-
Redact Data in Logging
Disables data logging for this panel to support data redaction requirements. This feature is available upon request and is subject to change.
Test
Use the Test feature to run the configured query and verify it returns the expected results before the flow goes live. Results can be viewed in two formats:
View JSON: Displays the query results as a structured JSON object.
View Table: Displays the query results in a tabular format for easier readability.
Query Settings
Table Select the SharpenDB table to query.
Use Dropdown: Select from existing tables in the environment.
Use Variable: Reference a variable containing a string that matches an existing SharpenDB table name.
Fields Select the field (column) to include in the query results. Add additional fields as needed to return multiple columns.
Use Dropdown: Select from the available fields in the selected table.
Use Variable: Reference a variable containing a string that matches an existing field name in the table.
-
Where
-
Define one or more conditions to filter which records are returned. Only records that match the specified conditions will be included in the results. Each condition consists of the following:
-
Field
Use Dropdown: Select from the available fields in the selected table.
Use Variable: Reference a variable containing a string that matches an existing field name in the table.
-
Operator
Select the comparison operator to apply to the condition. Available options are in the table below.
-
Value
Enter the value to compare against the selected field.
-
-
Operator |
Description |
|---|---|
|
Equal to |
|
Not equal to |
|
Greater than |
|
Less than |
|
Greater than or equal to |
|
Less than or equal to |
|
Checks if a value matches a specific condition, commonly used with |
|
Pattern matching using wildcards ( |
|
Checks whether a value is or is not |
|
Matches any value within a specified list |
|
Ensures a value does not match any value within a specified list |
|
Checks if a value falls within a specified range (inclusive) |
|
Checks if a value falls outside a specified range (inclusive) |
-
Where Operator
-
Select how multiple Where conditions are combined when more than one is defined.
AND: All conditions must be true for a record to be returned.
OR: Records matching any one of the conditions will be returned.
-
Result Controls
-
Sort By
-
Select a field to sort the result set by. Results will be ordered according to the values in the selected field.
Use Dropdown: Select from the available fields in the selected table.
Use Variable: Reference a variable containing a string that matches an existing field name in the table.
-
-
Distinct
-
When enabled, the query filters out duplicate entries and returns only unique values in the result set.
Off (default): All matching records are returned, including duplicates.
On: Only unique records are returned.
-
-
Limit
-
Restrict the number of records returned by the query. Useful for controlling result set size and improving query performance.
Use Number: Specify a fixed numerical limit.
Use Variable: Reference a variable containing a numerical value.
-
-
Offset
-
Specify the number of records to skip before the query begins returning results. Used in combination with Limit to paginate through large result sets.
Use Number: Specify a fixed numerical offset.
Use Variable: Reference a variable containing a numerical value.
-
-
Unpaginated Count
-
When enabled, the query returns the total number of records that match the conditions, regardless of any Limit or Offset values applied. Useful for knowing the full result count while still paginating the data.
Off (default): Only the paginated result set is returned.
On: The total matching record count is included in the response.
-
Variables
Define variables to store specific values from the query results for use in subsequent panels. Each entry consists of:
-
Name
Enter a unique name for the variable. This variable can be referenced throughout the rest of the flow using
$(variableName)syntax.
-
JSON Path
Enter the JSON path to the specific value you want to extract from the result set. The path follows the format
$.results.0.fieldName, wherefieldNameis the column you want to retrieve from the first result row.
For example, if your field name is areaCode, the JSON path would be $.results.0.areaCode. You could name the variable areaCodeReturned and then reference it later in the flow as $(areaCodeReturned).
Extracting More Than 10 Variables
The Variables section supports a maximum of 10 entries. If your table has more than 10 fields you need to extract, use the following pattern to work around this limitation.
Step 1 — Capture the full result set in a single variable
In the Variables section of the SharpenDB SELECT panel, create one variable with the following configuration:
Name:
ResultsJSON Path:
$.results[0]
This stores the entire first result row as a JSON object in $(Results), giving you access to all fields regardless of how many there are.
Step 2 — Extract individual values using a Set Variable panel
Add a Set Variable panel immediately after the SharpenDB SELECT panel. For each field you need, create a variable with the following configuration:
Variable Name: The name you want to use to reference this value in the flow (e.g.,
ID)Value Type: Expression
Function: JSON Path
Value:
$(Results)JSON Path:
$[0].FieldName— replaceFieldNamewith the exact column name from your table (e.g.,$[0].CustomerID)
The extracted value can then be referenced anywhere downstream in the flow using $(ID) or whatever name you assigned.
Example
If your table contains a CustomerID column and you captured the result row as $(Results), you would set $[0].CustomerID as the JSON Path in the Set Variable panel. The resulting variable $(ID) will hold that customer's ID for use in routing, messaging, or further lookups.
Timeout
Specify the number of seconds to wait for the query to return a result before timing out. If the timeout is reached, the flow will route through the Timeout exit path.
Use Dropdown: Select a numerical value from the available options.
Use Variable: Reference a variable containing a numerical value.
Exit Paths
-
Default
The path taken when the SELECT query executes successfully and returns results.
-
Timeout
The path taken if the query does not complete within the specified timeout period, typically due to a slow or non-performant query.
-
Error
The path taken if an error occurs during query execution.
Related Articles
Set Variable Panel [internal Confluence reference, not migrated in this run]
This article is part of a series on Admin Configuration topics.