afraid-scarlet•2y ago
display a table
Hi all!
Any way to craft like a Table step where data collected calling an API is displayed?
Like JSON to table thing..
Thank you all and sorry for my naive question.
6 Replies
Yes, you can display data collected from an API call in a table-like format using variables and blocks in Voiceflow. Here's a step-by-step guide:
1. API Block: Use an API block to make a request to your desired API. The API block will allow you to retrieve data from an external database.
2. Mapping the Response: Once you've made the API call, you'll receive a response. You can map this response to a variable. For example, if you're retrieving user profile data, you could map the response to a variable called
userprofile
.
3. Displaying the Data: To display the data in a conversational format, you can use a Speak block. In the Speak block, you can reference the variables that you've mapped the API response to. For example, if you've mapped a user's name and email to the variables name
and email
, you could write in the Speak block: "The user's name is {name} and their email is {email}."
4. Formatting the Data: If you want to display the data in a more table-like format, you could use newline characters (\n
) to create line breaks in the Speak block. For example: "User Information:\nName: {name}\nEmail: {email}".
Remember, the Speak block in Voiceflow doesn't support actual table formatting, but you can use text and variables to create a similar effect.
Please note that the way you map the API response to variables will depend on the structure of the API response. You might need to use dot notation to access certain pieces of data in the response. For example, if the response is a JSON object that looks like this: { "user": { "name": "John", "email": "john@example.com" } }
, you would map the name to a variable with response.user.name
.
I hope this helps! Let me know if you have any other questions.If you're using a Chat type agent, you can use markdown to format your response as a table.

afraid-scarletOP•2y ago
This saves my life! 👏👏
Can you do same for a chart or the likes?kinda mermaidjs
You can use mermaidjs in a chat widget extension.
More details here: https://developer.voiceflow.com/docs/render-custom-widgets-effects
Voiceflow
Custom Widgets & Effects (beta)
Render custom widgets like file upload, date pickers, and more!

afraid-scarletOP•2y ago
sounds incredible!!