Skip to main content

Notifications

Calling Actions from Copilot Studio
Answered

Filtering out string from an array/ string/ Looking for any viable solution

Posted on by 5

Hello Good people of the forum!

 

I need your help. I work at the helpdesk of a small startup and am just a noob in power virtual agent. I read some content and even though I am not from computer science background, I thought I could also build a "no code bot". The idea is very simple: The bot will greet and then ask for email. After the user provides email, the bot will check if the email address belongs to a group, if yes, it will send an email with the user query to the sales team. If not, then the bot will give the user a link to fill up a form. 

So far, I have done the following:

IamAlexis_0-1654756966123.png

The bot asks for the email input and I stored the value in a string variable.

In the next step, I list the group members

IamAlexis_1-1654757209665.png

Then I filter the query and set a condition where if the result is greater than 0, I should get a true value otherwise false.

greater(length(body('Filter_array')),0). I pass the value from compose to the pva. 

IamAlexis_2-1654757344520.png

 

It is not working. I tried a couple of different filtering parameters as well but nothing is working 😞 I either get true for all or false for all. the email is under "mail" in the array. I will try and figure out the next steps if I can get past this. If this is not at all the right approach, would greatly appreciate pointing or nudging towards the right direction.

Looking forward to some help and guidance. 

 

Best,

Alexis

Categories:
  • Verified answer
    SupportBryn Profile Picture
    SupportBryn on at
    Re: Filtering out string from an array/ string/ Looking for any viable solution

    Hey there @IamAlexis,

     

    I don't necessarily know that this will fully fix the issue, but a good place to start can be simplifying your comparison there, to help break out the steps individually. Instead of doing that compose there, what you can do is add a condition branching action, and make use of the empty() expression, which is a more direct way to check if the array from your filtering has any items in it.

     

    You can set up the comparison where you check if empty(<the output of Filter Array>) is equal to false (that exact value, no capitalization and no quotes around it). If that is the case, then you know that you had an email address that matched the input and proceed from there, otherwise you can return whatever value you are using as the default value for not having found it.

     

    Hope that helps you start making progress! Let me know if there's more we need to do.

     

    Thank you for using Microsoft Power Platform Communities!
    Bryn Baker
    Support Engineer
    Microsoft Power Platform
    If this post helps, then please consider accepting it as the solution to help other members find it more quickly! Have a great day!

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

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

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 137,998

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard

Featured topics