rare-sapphire•17mo ago
Response/JSON path for data retrieval and displaying stored data to the user
Hi there, running into some issues with Voiceflow and the proper capture response notations it expects to be able to properly retrieve, store, and display information that is stored within a variable.
Capture Response/JSON Path for Retrieval:
What is the correct Response/JSON path or notation that I should include in my capture response fields to retrieve information from an API endpoint for a key called "summary"? How can I properly store it in a Voiceflow variable named "chatbot_summary" for later access? The key returns as a string.
Displaying Stored Data:
After storing string data into a variable, how can I retrieve and display the string stored in the "chatbot_summary" variable to a user in a message on Voiceflow?
Example Payload
To help illustrate my query, here's a generic example of our payload structure. I need to capture the string within "summary" from this data:
[
{
"recipient_id": "1234567890abcdef",
"custom": {
"user_id": "1234567890abcdef",
"question": {
"message": "Which product is recommendeded for afternoon activities?"
},
"summary": "Hello! Here’s a great option for afternoon activities: Product A. Ideal for your needs!",
"products_detail": [
{
"name": "Product A",
"seo_description": "Product A is known for its balanced effects.",
"background": null,
"type": "null",
}
]
}
}
]
4 Replies
from the first item only
rare-sapphireOP•17mo ago
Hi, I'm sorry I'm not understanding your response..do you mind elaborating?
I'm trying to understand what the capture response or notation that I should include in my capture response fields to retrieve information from my API endpoint/payload (see above for example) for a key called "summary"?
response[0].summary is the key to get the first summary from the response
rare-sapphireOP•17mo ago
Thanks for the clarification @W. Williams (SFT) when I tried your suggestion, see attached image for what I get as the output raw response. I wasn't receiving an empty array before. Do you know what the issue might be by chance?
