An Azure service that automates the access and use of data across clouds without writing code.
Hello @josh benut
Thanks for providing the details and the troubleshooting you've already performed.
The behavior you're seeing is expected under the Adaptive Cards specification, not specific to the Azure Logic Apps Consumption plan or the Microsoft Teams connector.
When Input.ChoiceSet has isMultiSelect: true, it returns the selected values as a comma-separated string, not a JSON array.
1. Is the comma-separated response expected?
Yes. For example, a multi-select ChoiceSet may return:
{
"choices": "opt1,opt2,opt3"
}
Your Parse JSON action fails because its schema expects an array, while the actual response contains a string.
2. How should choice values containing commas be handled?
The recommended approach is to separate the user-facing display text from the internal choice value.
For example:
{
"type": "Input.ChoiceSet",
"id": "choices",
"isMultiSelect": true,
"choices": [
{
"title": "Paris, France",
"value": "paris_fr"
},
{
"title": "London, United Kingdom",
"value": "london_uk"
},
{
"title": "New York, USA",
"value": "new_york_us"
}
]
}
The title can contain commas because it's the displayed label. The value should use a comma-free identifier.
You can then map the selected identifiers back to their descriptive names later in the workflow.
3. How can the response be converted into an array?
In your Parse JSON action, define choices as a string:
{
"type": "object",
"properties": {
"choices": {
"type": "string"
}
}
}
Assuming you're parsing the response's data object, add a Compose action with this expression:
split(
coalesce(body('Post_adaptive_card_and_wait_for_a_response')?['data']?['choices'], ''),
','
)
For a response containing:
paris_fr,london_uk,new_york_us
The resulting array is:
[
"paris_fr",
"london_uk",
"new_york_us"
]
You can then use the Compose output in an For each action.
One consideration: if no choice is selected, the expression above can produce an array containing an empty string. If an empty selection is allowed, handle that condition before splitting.
4. Can the connector return a native array automatically?
No documented setting in the Microsoft Teams Post adaptive card and wait for a response action that changes the multi-select ChoiceSet output into a native JSON array.
The comma-delimited format is defined by Adaptive Cards itself, so changing the Parse JSON schema alone won't change the returned value.
For this scenario, using comma-free choice identifiers followed by split() is the straightforward supported approach.
Therefore, keep commas in the display labels if needed, but not in the underlying choice values. Parse the response as a string and convert it into an array using split() before processing the selected items.
Hope this helps!
References:
- Adaptive Cards - Input.Choice
- Adaptive Cards - Input.ChoiceSet
- Azure Logic Apps - Workflow expression functions
Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution. Thank you.