genetic-orange•2y ago
JavaScript
Hi I need help with javascript. I have an API call to bring me an answer from Flowise and the answer would look like this in the provided image. what I want to do is showing the user the response without the main and sub category as shown in the picture. and I will be sending the full response with the categories to my google sheet. my main problem right now is finding a way not to show it to the user. or if there is another approach to it. Thanks


1 Reply
To achieve your goal of showing the user a response without the main and sub-category, while still sending the full response to your Google Sheet, you can use the "Capture Response" feature in Voiceflow to selectively save and manipulate the data received from your API call. Here's a simplified approach:
- After making the API call, use the "Capture Response" section in your API block to selectively map the data you want to show to the user to a variable. This allows you to exclude the main and sub-category from what the user sees.
- For the data you wish to send to Google Sheets, ensure you capture the entire response or the specific parts including the main and sub-category in separate variables.
- Use these variables accordingly in your project: display the user-focused variable in your chat responses and use the full data variable for your Google Sheets integration.
This method ensures that the user only sees the information you want them to see, while you still have access to the full data for backend processes like updating your Google Sheet.
For more detailed guidance on working with API calls and managing responses in Voiceflow, consider exploring the following resources:
- Using the Function Step
- Functions CMS