Datastore

Use the datastore node to perform actions on the system log or a datastore that you have created in the Content section of Studio.

Note:

The icon for the datastore node in the call flow editor is enhanced when the selected datastore is the system log.

How-To Video

Name

Give the node a name.

Datastore

The system log is selected by default.

Alternatively, select from any of the datastores in the Studio account.

Action

The insert action is selected by default.

Action

Description

Insert

Insert a row in the datastore with data from the call flow.

Fetch

Fetch values from a datastore. Add these values to variables in the call flow.

Update

Update a row in the datastore with data from the call flow.

Delete

Delete a row from the datastore. The datastore node cannot delete a row from the system log.

Insert Action

Insert a row in the selected datastore.

  1. From the Action menu, select Insert.

  2. Select Debug Logs to insert a debug log while debug logs are enabled.

    To enable debug logs, see Task Properties.

    For more information on debug logs, see Debug Logs.

  3. Insert values.

    For each datastore column, click the pencil to the right of the Value field. This will open the Expression Builder.

  4. Optionally, select a variable to store the inserted row ID.

    If the variable has not been created yet, type the name of the variable in the field.

Fetch Action

Fetch values from the selected datastore. Add these values to variables in the call flow. For example, you may want to forward customer phone numbers to a sales representative.

  1. From the Action menu, select Fetch.

  2. From the Row Limit menu, select the maximum number of records to return that match the query condition, or select no-limit.

  3. Build the Query Condition.

    Following are some general guidelines to help you build the query condition.

    1. Click Add Node to begin.

    2. Select from the standard operators, such as equal to, not equal to, starts with, and doesn't end with.

    3. Create complex queries with nodes and groups.

    4. Click Preview to ensure the right records are matched.

    Note:

    If the query compares a number column (integer or double) with a string value, no data is fetched, and no changes are made to the datastore and returned values.

    The exception to this is if the query compares a number column with an empty string. The value "0" is used in place of the empty string.

    Studio displays a warning when you click Preview. The preview action does not have access to variable values, so if the query compares a number column to a variable, Studio displays a warning. You should check that the variable value is a number. If it is a number, the query will resolve successfully at runtime.

  4. Order and sort the datastore.

    Select up to three columns. The datastore sorts on the first selected column, then the second, then the third.

    1. From the Order by menu, select a datastore column.

    2. Select the sort order as Ascending or Descending.

  5. Fetch from the datastore values matched by the query condition.

    1. From the Collection Structure, select a JSON name-value pair.

      When selected, the path to the name-value pair appears in the JSON Path field.

    2. To edit the JSON path, select Editable JSON. For more information, see Editable JSON.

    3. From the Assign path to variable field, select a variable to assign to the JSON path.

      If the variable has not been created yet, type the name of the variable in the field.

      If the datastore column's values are encrypted, select a secure variable to assign to the JSON path.

    4. In the Default Value (optional) field, assign a default value to the variable.

      The default value itself can be a variable. Type two curly brackets {{ and select from the available options.

    5. Click Assign.

    6. Repeat using another JSON name-value pair from the Collection Structure.

    This is complete when each fetched value to use in the call flow is assigned to a variable.

Update Action

Update a row in the selected datastore.

  1. From the Action menu, select Update.

  2. Identify datastore columns to update and update values.

    1. From the Allow Update column, select the datastore columns to update.

    2. To enter updated values, click the pencil to the right of the Value field.

      This opens the Expression Builder.

  3. Enter the row ID to update.

    This can be entered as a variable.

Delete Action

Delete a row from the selected datastore.

  1. From the Action menu, select Delete.

  2. Enter the row ID to delete.

    The row ID can be entered as a variable.

Note:

The datastore node cannot be used to delete rows in the system log.