Cards - Choices
Good evening,
Can you please provide an example of how to use the Choices input for adaptive cards? I am receiving the following error when I try to pass a list.
item.to_dict() for item in property_value AttributeError: 'str' object has no attribute 'to_dict'
Thanks, Ken
Modified the inputs.py with the following and it worked:
super().init( serializable_properties=[], simple_properties=[ 'id', 'type', 'isMultiSelect', 'style', 'value', 'height', 'separator', 'spacing','choices' ], )
example list to pass it
choice_list = [{'title':'customer1', 'value':'customer1'},{'title':'customer2', 'value':'customer2'}]
mychoice = Choices(choice_list, id='customer')
This is still an issue, and I don't like to have to modify a 3rd party library unless necessary, this method works without the need to modify the WebexPythonSDK. This will modify the attributes of your instance rather than the library. Keep in mind that if you upgrade the library, your modifications may be overwritten. However, this is a quick fix until the issue is resolved and.
choices = [{"title": "foo", "value": "1"}, {"title": "bar", "value": "2"},]
report.serializable_properties = []
report.simple_properties.append("choices")