web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Create a chat from out...
Copilot Studio
Unanswered

Create a chat from output of query in "list rows present in a table"

(0) ShareShare
ReportReport
Posted on by

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: "

Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Create_a_chat' at line '1 and column '3558' is invalid. Action 'Apply_to_each' must be a parent 'foreach' scope of action 'Create_a_chat' to be referenced by 'repeatItems' or 'items' functions.'.'."}}". Code: 0x80060467 InnerError: '.
 
I know when I manually put in multiple email addresses in the "create a chat" flow I'm able to generate a single group chat so why can't it function the same way when passing multiple addresses in from the excel query?
 
I've searched for a way to concatenate the email addresses with ";" or to have them stored as an array variable but to no avail. No matter what, I get a for each and have to either deal with multiple chats or a failed flow. Multiple chats will not work for my use case. This will cause the plug to be pulled on my project so I can't just "deal" with the inconvenience of it unfortunately. 
 
In closing: Is there a way to get email addresses returned from my excel query to act as acceptable inputs for the "create a chat" flow without it generating multiple chats?
 
excel chat error1.pngexcel chat error2.pngexcel chat error3.png



I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    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'), ';')

     

    selectemail_joinwithcolon.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 255 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 205 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 101 Moderator

Last 30 days Overall leaderboard