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:
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
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.
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
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!