wonderful-wolf-37241
05/28/2024, 10:58 PM{x}
control in Items
to add choices via variable, the error Error: object type is not allowed: array type
is given.
Is there a way to generate input choices from an existing array variable?
I checked the docs, but this topic does not appear to be addressednice-salesclerk-98217
05/29/2024, 8:30 AMaloof-traffic-22451
05/29/2024, 1:27 PM{ label: "Some option", value: "1" }
wonderful-wolf-37241
05/29/2024, 6:47 PMarray type is only allowed
...-- I tried with the array var type set both as options
and as string
, same result -- do you happen to know what the full text of that error is supposed to be? // screenshot of error attached ( @User this is the the {x}
field setup in the Single Choice card
https://cdn.discordapp.com/attachments/1245149272412913764/1245448436917207164/botpress-array-var-single-choice-error.png?ex=6658c9be&is=6657783e&hm=812271c9c9d6c73b7e18c8071565ad67a94d22a172bf2b618c8b128e1926fe48&aloof-traffic-22451
05/29/2024, 6:59 PMaloof-traffic-22451
05/29/2024, 6:59 PMsquare-energy-41150
05/29/2024, 6:59 PMsquare-energy-41150
05/29/2024, 6:59 PMwonderful-wolf-37241
05/29/2024, 7:02 PMwonderful-wolf-37241
05/29/2024, 7:22 PMreport_01HZ2WT57V0C4Z59AFM6WHKRR9
aloof-traffic-22451
05/29/2024, 7:44 PMwonderful-wolf-37241
05/29/2024, 7:54 PMschema
/ {x}
input doesn't want the double curly braces around the var name, that was the problem! I was putting them in there because some other interface elements (e.g. text card, etc) that are marked with the @
want the double curly braces (if the @
is not used). Removing the double curly braces solved the problem and produced the expected behavior. Thanks very much for your kind help @aloof-traffic-22451 !wonderful-wolf-37241
08/15/2024, 5:00 PM{label:"foo",value,"bar'}
format?wonderful-wolf-37241
08/15/2024, 6:29 PMarray
type will handle these options with no modification, and the single choice card will process the array as expected, given that the objects in the array conform to the above format, and no curly braces are used in the single choice card's {x}
control (that is, the variable should be entered into that field without surrounding curly braces}great-insurance-89011
08/30/2024, 7:28 AMgreat-insurance-89011
08/30/2024, 7:35 AMwonderful-wolf-37241
08/30/2024, 6:01 PM