In this article, we'll show you how to set up and use the feature to store custom data and relate it to Talkdesk interactions inside Studio Flow(s).
Step 1: Creating an OAuth client.
Create an oAuth client with the scope (interaction-custom-fields:write). Here is an example:
- Go to “Builder -> OAuth clients” and generate a new OAuth client.
-
- Choose a grant type.
- Add the scope “interaction-custom-fields:write” and press the button to create the new OAuth Client (you will be able to download important data like client ID and client secret).
- For more information regarding oAuth clients, click here.
Step 2: Creating a Custom Integration
Create a custom connection using the Reporting Custom Fields API to store the custom data (related to a Talkdesk interaction). Here is an example:
- Go to “Builder -> Integrations” and create a new integration (type “Custom Integration).
- On the custom integration settings, you will need to fill data related with the regional cloud of your Talkdesk account:
-
- Base path: check the info here (Supported Regions and Base URLs).
- Authentication type: We recommend using “OAuth2 Client Credentials”, with:Client id: the client id from the OAuth client created on the previous step.
- Client secret: the client secret from the OAuth client created on the previous step.
- Access Token URL: check the info here (base url’s).
-
- For more information regarding custom integrations, click here.
Step 3: Creating an Action
Create an action to insert the custom data on Talkdesk.
This action will be used by Studio Flow.
Here is an example:
- Go to “Builder -> Integrations -> <<Your Custom Connection >>” and create an action.
- To invoke the Reporting Custom Fields API to store the custom data, you will need the following configurations:
- Relative path: Post -> interaction-custom-fields.
- On the input schema you can use something like this:
{
"$id": "root",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"interaction_id": {
"type": "string",
"title": "interaction_id"
},
"text_field_1": {
"type": "string",
"title": "text_field_1"
},
"text_field_2": {
"type": "string",
"title": "text_field_2"
},
"text_field_3": {
"type": "string",
"title": "text_field_3"
},
"text_field_4": {
"type": "string",
"title": "text_field_4"
},
"numeric_field_1": {
"type": "number",
"title": "numeric_field_1"
},
"numeric_field_2": {
"type": "number",
"title": "numeric_field_2"
},
"numeric_field_3": {
"type": "number",
"title": "numeric_field_3"
},
"numeric_field_4": {
"type": "number",
"title": "numeric_field_4"
},
"timestamp_field_1": {
"$id": "#root/timestamp_field_1",
"title": "Timestamp_field_1",
"type": "string",
"default": "",
"examples": [
"2024-01-31T12:24:11"
],
"pattern": "^.*$"
}
},
"required": [],
"additionalProperties": false,
"title": "root schema"
}
- There is no need for an output schema.
- You can test this action and check if it appears on Custom Interaction Field Report:
- A successful test will receive a “204” code.
- After this, you can publish the action and start using it in Studio.
- For more information regarding actions, click here.
Step 4: Using the action on a Studio Flow:
Once the previous steps have been completed, you can use this feature on a studio flow.
To get the custom data, you can use components like “Execute action” or “Salesforce Data Dip” to collect the custom data to be stored on the Interaction Custom Fields Report.
To store/insert the data you need to use an “Execute action” with the following steps:
- Insert a component type “Execute Action” and:
- Choose the custom integration created on step 2.
- Choose the action created on step 3.
- On the inputs you should use the interaction ID (on voice flow and a digital flow it’s available on the first component) and you can choose which custom fields to use/store.
Here is a demo flow created to test this feature:
For more information regarding studio flow components, click here.