Functions in Query Rules
Functions in Query Rules
Yext Query Rules provide a powerful "if-this-then-that" framework that allows you to define certain actions that will be triggered in the presence of particular criteria. Leveraging Yext Functions as actions in Query Rules enables users to ask questions about ever-changing or user-specific data that typically isn't stored in your CMS, but rather lives in external sources. How is this possible?
When developers use Yext Functions to write custom TypeScript functions as actions in Query Rules, their custom code runs when certain criteria are met. Then, developers can design custom frontend cards to display the data that gets fetched from external sources as direct answers. This way, they can integrate real time data from external APIs to power all sorts of amazing use cases in Search. Check out some popular uses cases below:

Personalized User Data
Allow users who are logged in to their account to surface personal information about their account, user history, and membership plan. Help them take that next step with curated CTAs for each type of result.

Reservation Management
Allow users to track and manage their upcoming reservations with restaurants, hotels, airlines, and more all through search.

Package Tracking
Allow your retail customers to type in their tracking number or ask questions like, "where is my package?" and get accurate status updates from your delivery provider.

Stock Prices
Pull financial information like stock prices from Finance APIs and provide your users with a real-time snapshot of the market.

Outage Detection
Allow users to search for service outages in their area, and prompt them to report one if there is no record.

Explore Related Features
Explore Related Features