Voiceflow PartnersVPVoiceflow Partners
Powered by
KaleksyK
Voiceflow Partners•5mo ago•
8 replies
Kaleksy

Using API step's data in function step

Hi all!

I'm currently building a workflow where I get data using API step. I pass the data in to Function step and then I would like to handle data there. The end goal would be filter data by using user input and show the result in chat.

Example:
Bot: Which city you live in?
User: Stockholm
Bot: Here are the recycling points in Stockholm: adress 1, address 2 and address 3.

I currently manage to fetch data with API step and I can pass it in function step. But then the problems starts.

Is it possible to access apiData in function step and filter it? It's hard to degub this because I haven't found console in Voiceflow and some error are hard to catch.

apiData and recyclingPoints are predefined in API step.

// This gets full JSON
const apiData = args.inputVars.apiData;

//This gets first recycle point's street name
const streetName = args.inputVars.recyclePointStreet;

// User's input for question "Your city?"
const userCity = args.inputVars.userCity;

// Here I send data in to chat as a test
payload: {
message:
You said: "${userCity}" and "${streetName}"
You said: "${userCity}" and "${streetName}"
,
},
Voiceflow Partners banner
Voiceflow PartnersJoin
Exclusive community for Voiceflow Solutions Providers & Content Creators.
13,076Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Recent Announcements
jacklyn

# Let your agents search the web 🔎 Hey everyone! We just released the web search tool for the agent step! Your agents can now automatically search the web for information, letting your agent supplement the LLM's knowledge and the data in its knowledge base with live, up-to-date information. Plus.... * You can restrict searches to specific domains, so your agent only searches sites that you own * This is a tool, so you remain in control of when the agent searches the web * Results are automatically summarized in a way that your agent can automatically understand Under the hood, we're using OpenAI's web search API. Give it a try, and let us know what you think! https://docs.voiceflow.com/changelog/native-web-search-tool

jacklyn · 4mo ago

jacklyn

jacklynbiggin's Thread

jacklyn · 4mo ago

hurt-tomato

connor_maclean's Thread

hurt-tomato · 4mo ago

Similar Threads

POST api step
uncertain-scarletUuncertain-scarlet / ❓┃ask-a-question
2y ago
Function step crashes canvas
Steve B. | IntelleSync.ukSSteve B. | IntelleSync.uk / ❓┃ask-a-question
3y ago
API Step sent always 0
uncertain-scarletUuncertain-scarlet / ❓┃ask-a-question
2y ago
Using Function Block in WhatsApp chat
naughty-peachNnaughty-peach / ❓┃ask-a-question
2y ago