Voiceflow PartnersVPVoiceflow Partners
Powered by
instant-harlequinI
Voiceflow Partners•3y ago•
2 replies
instant-harlequin

Custom Actions Youtube Tutorial question

Hello Voiceflow team,

I'm reposting my question from the #💬┃general-chat channel here:

This is regarding custom actions.

Hi I'm following the custom action youtube tutorial for rendering custom actions and I noticed that last_event is returning null after I make a carousel selection. Is last_event still being populated after custom action step executes?

Video source: https://www.youtube.com/watch?v=2V46rOkkprg&t=130s

This is the javascript code I used from the tutorial:

const makeCard = (name, sku) => ({
 "title": name,
  "description": {
    "text": "something about tea 1"
  },
  "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Longjing_tea_steeping_in_gaiwan.jpg/1920px-Longjing_tea_steeping_in_gaiwan.jpg",
  "buttons": [
    {
      "name": "button " + name,
      "request": {
        // corresponds with the path selected
        "type": "tea_selected",
        "payload": {
          "sku": sku,
          "label": "button " + name,
          "actions": []
        }
      }
    }
  ] 
});

for (let i = 1;i <= 10; ++i) {
  carousel_dynamic.cards.push(makeCard(`tea ${i}`, `t-${i}`));
}

// must stringify json data so other nodes know the shape of this object
carousel_dynamic = JSON.stringify(carousel_dynamic);



// last_event returns null
tea_selection = JSON.stringify(last_event);
const makeCard = (name, sku) => ({
 "title": name,
  "description": {
    "text": "something about tea 1"
  },
  "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Longjing_tea_steeping_in_gaiwan.jpg/1920px-Longjing_tea_steeping_in_gaiwan.jpg",
  "buttons": [
    {
      "name": "button " + name,
      "request": {
        // corresponds with the path selected
        "type": "tea_selected",
        "payload": {
          "sku": sku,
          "label": "button " + name,
          "actions": []
        }
      }
    }
  ] 
});

for (let i = 1;i <= 10; ++i) {
  carousel_dynamic.cards.push(makeCard(`tea ${i}`, `t-${i}`));
}

// must stringify json data so other nodes know the shape of this object
carousel_dynamic = JSON.stringify(carousel_dynamic);



// last_event returns null
tea_selection = JSON.stringify(last_event);
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

Combining Agents with Custom Actions
GuidoGGuido / ❓┃ask-a-question
8mo ago
YouTube Tutorial with major errors in the structure logic?
OutisOOutis / ❓┃ask-a-question
8mo ago
API tutorial
resonant-amethystRresonant-amethyst / ❓┃ask-a-question
2y ago
KBsearch not working in the tutorial
BenjaminBBenjamin / ❓┃ask-a-question
8mo ago