cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IamAlexis
New Member

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
SupportBryn
Microsoft
Microsoft

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!

View solution in original post

1 REPLY 1
SupportBryn
Microsoft
Microsoft

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

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Canadian Cloud 2022 768x460.png

Register for a free PVA chatbot creation workshop.

Learn how to respond rapidly to your customers and employees at scale, using intelligent conversational chatbots.

Top Solution Authors
Top Kudoed Authors
Users online (5,066)