Loading

Einstein Bot / Agentforce Bot: Question Element Choice Matching Uses Index Before Label

Udgivelsesdato: Jun 2, 2026
Beskrivelse

How Index-Based Matching Works?

While using question element in Einstein bot, the choice entered by the end user is matched with the index of the choices (like an array) and if the index match is not found then it looks for the matching label. This may cause confusion particularly when the choices presented are numbers.

To understand this better, create a question element to choose a number from the choices below:

0
1
2
3

Below is the illustration of how internal indexes point to these values:

[1] -> 0
[2] -> 1
[3] -> 2
[4] -> 3

Now if a user enters value 1, it is first matched with the index of these values. Since the index corresponds to value 0 which will be returned. Similarly, entering 2 will return value 1. For 4, it will return 3 and so on.

Now, if we enter 0, there are no such index in the array so it will check the labels. So, label 0 which is at index 1 will now be matched. This is working as designed. 

Løsning

To avoid unexpected results when using numeric choices in a Question element:

  1. Order your choices so that each numeric label matches its array index position (e.g., the first choice has value '1', the second '2', etc.)
  2. Alternatively, avoid using purely numeric choices if index-label ambiguity is a concern.
  3. Test the Question element with sample inputs to confirm the expected value is returned.
Yderligere ressourcer

Use a Dialog Question Step

Vidensartikelnummer

000396914

 
Indlæser
Salesforce Help | Article