Function Instructions | Yext Hitchhikers Platform

What You’ll Learn

By the end of this unit, you will be able to:

  • Explain how to set up a function instruction
  • Understand where functions are stored in the Yext platform
  • List multiple use cases for the function instruction

Overview

Function steps leverage the Yext Functions framework to give Yext Chat access to user-defined serverless Typescript functions. This allows the bot to perform complex tasks like:

  • Transforming, reading, and writing data to external APIs
  • Using open-source libraries to manipulate or analyze data
  • Performing complex business logic

The function has access to the full history of the conversation, including any collected data, as well as any additional context data you’ve provided.

Learn more about this instruction action type, in the Function Instruction reference doc .

Setting up a Function Instruction

To set up this instruction, you will need to, first, make sure you have a plugin created ahead of time. This is where you will reference the functions that your bot will utilize. Read more in this guide .

Once you are in the Add/Edit an Instruction modal, you have the following inputs to complete:

  • Instruction: A description of what you want the bot to do.
  • Plugin: A Plugin is a resource that contains at least one Function. Plugins can be configured on an account using the Yext CLI.
  • Function: Select the function you want to use from your Plugin.

Example

The function instruction can be used for things like sending data that was collected in a previous Collect instruction to a third party.

Going back to the “Get a Demo” goal example from previous units, we can use the personal data gathered from the bot and send it to Marketo so they can be contacted via email by a marketing or sales team.

First, there needs to be a collect instruction to gather data like the user’s email address, name, and any other relevant information. Then you can set up a function instruction to send the field values to Marketo using a plugin configured in your account.

Function instruction configuration in edit instruction modal

unit Quiz
+20 points
Daily Quiz Streak Daily Quiz Streak: 0
Quiz Accuracy Streak Quiz Accuracy Streak: 0
    Error Success Question 1 of 2

    True or False: In order to set up a function instruction, a plugin must be configured in the Yext account.

    Error Success Question 2 of 2

    The function instruction allows the bot to do things like:

    You're out of this world! 🌎

    You've already completed this quiz, so you can't earn more points.You completed this quiz in 1 attempt and earned 0 points! Feel free to review your answers and move on when you're ready.
1st attempt
0 incorrect
Feedback