Skip to main content

dynamic_autocomplete

Definition

dynamic_autocomplete is a property used in Veezoo's function configuration to provide a pattern that should be displayed in the autocomplete suggestions when a user is typing a question. This property can help guide users toward the correct usage of the function by providing clear and interactive prompts during the question-building process.

Usage

dynamic_autocomplete is a string that includes placeholders ($1, $2, etc.) for the arguments of the function. These placeholders are replaced by the actual arguments when the function is called. Note that it's optional, meaning that if it is not set, the system will use the dynamic_display_name instead, except for CB_One2Maybe where it needs to be explicitly set.

Example

Consider the Leap_Year function from the examples here. Here, dynamic_autocomplete is used to provide a user-friendly prompt:

function Leap_Year {
name: "Leap Year"
// Rest of function definition...
dynamic_autocomplete: "$1 in leap year"
// Rest of function definition...
}

In this example, when a user starts typing something like 'How many customers with birthdate in', 'birthdate in leap year' would appear as a suggestion, guiding them towards the correct usage of the Leap_Year function.

Guidelines

When defining dynamic_autocomplete:

  • Make sure to include all argument placeholders in the correct order. If your function has multiple arguments, they should be included as $1, $2, and so forth.
  • Try to make the phrase intuitive and user-friendly. It should guide users toward the correct usage of the function, while also fitting naturally into the language of their query.

Remember, the dynamic_autocomplete property can significantly enhance user experience by making it easier to utilize complex functions.