Here is my situation. I'm trying to create a chat with qualified colleagues based on user input from interaction with chatbot. My chatbot asks the user a couple of questions, stores the answers as variables, and then calls an action. In this action the variables are passed in, then it queries a table in a spreadsheet for colleagues matching the input criteria and returns their email addresses to the "create a chat in teams" flow. The problem arises that when I do this I get a for each created automatically because there are multiple emails and this creates multiple chats rather than a single group chat which is my goal. If I "compose" the output of email addresses from the excel connector and try to pass them in as a single variable from there I get the following error: "
Hi @Kog8790,
You could use a select action to only retrieve the email property values of each item. With a join function you can them together with a semi-colon character. That can be used in the create chat, which will avoid the apply to each.
Below is an example of that approach.
1. Add a Select action. Use the value of your List rows. Switch the Map field to text mode. Use the expression below
item()?['Email']
2. Add a condition action. This is to check if it has found matches by using a length function.
length(body('Select'))
3. Add the Create Chat in the If Yes. Use the expression below for the members to Add field:
join(body('Select'), ';')