Skip to main content

Notifications

Calling Actions from Copilot Studio
Answered

can output of join be concatenated with additional text in single expression?

Posted on by 189

In my chatbot the user can request assistance with a technical issue. The bot gathers input from the user and calls an action where the users input is checked against a couple of conditions to return results from a skills matrix to pair them with help in their region and with the desired skillset. All of this works fine. The current bug I'm working through with this is getting the flow to remove my email from the list of emails if I happen to be the user (since I get added to every chat the bot creates due to my profile being used to create the chats). I think I have the solution but when I try to add it as an expression I continue to get "the expression is invalid" error. Here is my expression: 

if(equals(outputs('Get_user_profile_(V2)')?['body/mail'], 'bot.me@email.com'), join(body('Filter_array_Equip_Type')?['Email'], ';')), concat(join(body('Filter_array_Equip_Type')?['Email'], ';'), ';', outputs('Get_user_profile_(V2)')?['body/mail']))

My only guess is concat may not be compatible with join somehow? I tried searching the interwebs but found no mention of if these two functions play nicely together. So, I'm bringing it to the forums to see if anyone here knows if these two are compatible or if I need to find a different expression.

  • Verified answer
    kgreen8790 Profile Picture
    kgreen8790 189 on at
    Re: can output of join be concatenated with additional text in single expression?

    I swear, at this point I'm just posting on here to jump start my own problem solving abilities. The last three posts I've done have led to me figuring out the solution just a few moments after posting the question. Something about putting it on here for the world to see makes me look at my code/process more critically and then I end up solving it. I'll leave this here along with the solution in case anyone else runs into this problem. 

    My issue was the double closing parenthesis on at the end of the first join function and I had to use select function to grab emails from array first. Totally spaced there I guess. Here is the correct code for this solution.

     

     

    if(equals(outputs('Get_user_profile_(V2)')?['body/mail'], 'Kevin.Green@convergint.com'), join(body('Select'), ';'), concat(join(body('Select'), ';'), ';', outputs('Get_user_profile_(V2)')?['body/mail'][0]))

     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Getting Started…

Welcome to the Power Platform Community! We appreciate your visit…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 138,006

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard

Featured topics