cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

If condition for amount of numbers

Hello. Wondering if anybody can help with this. I have created a BOT, but I am struggling with an IF condition. I have created the bot on the non coding side. I basically want the BOT to give two different responses to what a user inputs. The user will be asked to confirm a number. If this number is 5 characters or above, the user will be advised one thing and if the user inputs a number using 4 characters or below, they will be advised another scenario by the BOT. Just cant seem to be able to set a condition for this, only giving me the option to set a word as a condition.

 

 

Would appreciate if somebody could provide some feedback on how to do this 😀

29 REPLIES 29
Anonymous
Not applicable

Hi @Expiscornovus 

 

 

Thank you, I have changed this now to just have trigger phrases such as 'Emis' and 'CDB Code' etc. However, it is still getting stuck in the middle:-

Stuck.PNG

My compose inputs look like this:-

 

 

Compose1.PNG

The if's stated for each one are:-

 

 

Compose - 

if(lessorequals(length(triggerBody()['text']), 4), 'This appears to be an Emis CDB Org code support by Emis help. Please contact them directly.', if(equals(length(triggerBody()['text']), 5), 'This looks like one of our community codes''6 characters or more'))
 
Compose 2 - Peek Code reads 
{
    "inputs""@triggerBody()['text']"
}
 
Can you spot why it can be still causing it even after this? Thanks for your help Dennis, sorry I am dragging this out and if it is painful for you!
 
 
Kieran😁

 

 

Expiscornovus
Multi Super User
Multi Super User

Hi @Anonymous,

 

I see that the response of the bot is 'To connect with a person now, click on the following link'. That looks a lot like a response from the Escalate topic.

 

Are you by any chance using the '20198' text as a trigger phrase in the Escalate topic in the same bot?



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Anonymous
Not applicable

Hi @Expiscornovus 

 

I have checked my trigger responses on the escalate topic, but its just the preset ones that teams has given, so not sure why its doing it, I havent set any numbers as trigger phrases elsewhere now, so puzzled as to why its doing it 😶 Would you agree everything that I have shown you looks fine, or do you think there could be something else causing this now that I may have missed?

 

 

Thank you for you help so far again!

 

 

Kieran😀

Expiscornovus
Multi Super User
Multi Super User

Hi @Anonymous,

 

Thanks for checking the trigger phrases in the escalate topic.

 

I just noticed in the screenshot of your previous reply that the expression in the Power Virtual Agents Template flow is still using the EMIS text instead of the numbers.

 

If you are using CharacterCount is equals to 4 logic you also have to make sure that in the output of your flow it is sending that same number and not the EMIS text. Otherwise the condition action in the topic can't match it and it will always go the all other conditions branch.

 

Can you make sure that you are using this in the compose action:

if(lessorequals(length(triggerBody()['text']), 4), '4', if(equals(length(triggerBody()['text']), 5), '5', '6 characters or more'))

 

I would also add a message action under the All other conditions. 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Anonymous
Not applicable

Hi @Expiscornovus 

 

 

Sorry I thought I updated that, obvuously not! I have updated it now and that expression has been updated. However, on the compose for the output, just want you to check something if thats OK?

 

 

Output Compose.PNG

Should I be inputting the if statement that is in the first compose into the Output?😀

 

 

Thanks Dennis 

 

 

Kieran

Expiscornovus
Multi Super User
Multi Super User

Hi @Anonymous,

 

Thanks for updating the flow.

 

The value for the CharacterCount field in the Return value(s) to Power Virtual Agents should be the Outputs field from the Compose action with the expression.

 

So, what you currently have in your screenshot looks ok already  🙂



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Anonymous
Not applicable

Hi @Expiscornovus 

 

 

Thank you for that, I think its all set for that as the expression feield in Compose 1 reads 

if(lessorequals(length(triggerBody()['text']), 4), '4', if(equals(length(triggerBody()['text']), 5), '5''6 characters or more'))
 
Compose 2 has InputNumber set with:- 
 
{
    "inputs""@triggerBody()['text']"
}
 
Return Value has CharacterCount with Outputs set as 'Compose' . However, its still coming up with the message 'To connect with a person now, click on the following link: <link>. Not sure why its doing this if all the above is set and is correct? When I confirm a 4 or 5 digit number, its just getting stuck on the Action where its stating the Power Automate input, just doesnt seem to be getting further than that. See below:-
 
Input.PNG
 
Also, below is the code for the output, just incase there is an error in there, but I cannot see one?
 
{
    "kind""VirtualAgent",
    "inputs": {
        "statusCode"200,
        "body": {
            "charactercount""@{outputs('Compose')}"
        },
        "schema": {
            "type""object",
            "properties": {
                "charactercount": {
                    "title""CharacterCount",
                    "x-ms-dynamically-added"true,
                    "type""string"
                }
            }
        }
    }
}
 
 
I am thinking its a simple mistake, but just not sure why its getting stuck at the bit when everything else is set?🤔
 
 
Thanks for this Dennis, this has been a over a couple of days and really grateful for you sticking with me to see it out.
 
 
Kieran
Expiscornovus
Multi Super User
Multi Super User

Hi @Anonymous,

 

I had a look again at the screenshot of your confirm question. It looks like you typed the NumberVar instead of selecting it from the menu. It doesn't have the gray formatting like in my screenshots.

 

grayformatting.png

 

Can you select it from the menu?

 

canyouselectthevariable.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Anonymous
Not applicable

Ah @Expiscornovus  so sorry I must have jumped the gun and typed it all out instead of waiting for the drop down to come. Thats worked. I can now tweek this with certain responses and additonal conditions to certain codes, as I want it to recognise a code that is supported, dont want it to just accept any 5 digit code. Could I just have a list of the ORG codes with 5 digits and have it pull that through and recognise when one of them is being put in, same with the 4 digit codes?

 

 

I think apart from me tweaking that, unless you have any suggestions of how I can do that, I am very happy with this solution and really appreciate your time in helping me sort this honestly, its really helped me out in my new role! Very pleased 😁

 

Kieran

Expiscornovus
Multi Super User
Multi Super User

Hi @Anonymous,

 

Great to hear that it worked! 😃 Happy to help.

 

Regarding your new question about matching codes in a list, yes that would be possible. I would add more logic to the flow to support that requirement.

 

But maybe it is better to open up a new thread. This way we can help you separately with that new question. Saves other people going through the different pages of this conversation thread 😁

 

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements

Back to Basics: Tuesday Tip #2: All About Community Ranks

This weekly series is our way of helping the amazing members of our community--both new members and seasoned veterans--learn and grow in how to best engage in the community! Each Tuesday, we will feature new areas of content that will help you best understand the community--from ranking and badges to profile avatars, from Super Users to blogging in the community. Our hope is that this information will help each of our community members grow in their experience with Power Platform, with the community, and with each other!   Have you ever wondered how your fellow community members earn the different ranks available? What is the difference between an Advocate and a Helper, a Solution Sage and a Community Champion? In today's #TuesdayTip, we share the secrets and tips to help YOU keep your ranking growing--and why it's so important to our communities. What are community ranks? - Power Platform Community (microsoft.com)   Get the details in this Knowledge Base article that shows you what ranks are, how they are achieved, and what they mean to you as you engage with other community members on a regular basis. Once you start your journey in the community, ranking up, you'll find the benefits. So get busy with those kudos, solutions, and more! We can't wait to see how you rank!That's it for this week. Tune in for more Tuesday Tips next Tuesday and join the community as we continue to get "Back to Basics."

It's #MPPC23 Week! Check Out the Community Sessions and Events Happening in Vegas

After all the planning and preparing, the annual Microsoft Power Platform Conference is finally here! We are excited to see so many of our community in Las Vegas this week. To help make sure you don't miss any of the workshops, sessions, and events we have planned, make sure to check out this handy Community One-Sheet, and download the pdf today! Make sure to stop by the Community Lounge to meet @hugobernier, @EricArcher, @heaher_italent, and @AshleyFelts from our team! See you in Vegas!      

Join Us for the First-Ever Biz Apps Community User Group Meeting: Live from MPPC23

      Join us for the first-ever the Biz Apps Community User Group meeting live from the Power Platform Conference! This one hour user group meeting is all about discovering the value and benefits of User Groups! Discover how you can find a group in your local area or about specific topics where you can learn new skills and meet like-minded people as a user group member.   Hear from User Group leaders about why they do what they do and what resources they receive to help them succeed as community ambassadors. If you have never attended a User Group meeting before, this will be a great introduction! We hope you are inspired to find a group that meets your unique interests!   October 5th at 2:15 pm Pacific time   If you're attending #MPPC23 in Las Vegas, join us in person! Find out more here: https://powerplatformconf.com/#!/session/Biz%20Apps%20Community%20User%20Group%20Meeting%20-%20Live%20from%20MPPC/6172   Not at MPPC23? Attend vvirtually by registering here: https://aka.ms/MPPCusergroupmeeting2023    If you can't attend this meeting live, don't worry! We will record this meeting and share it with the Community at powerusers.microsoft.com 

Back to Basics: Tuesday Tip #1: All About YOUR Community Account

We are excited to kick off our new #TuesdayTIps series, "Back to Basics." This weekly series is our way of helping the amazing members of our community--both new members and seasoned veterans--learn and grow in how to best engage in the community! Each Tuesday, we will feature new areas of content that will help you best understand the community--from ranking and badges to profile avatars, from Super Users to blogging in the community. Our hope is that this information will help each of our community members grow in their experience with Power Platform, with the community, and with each other!     This Week's Tips: Account Support: Changing Passwords, Changing Email Addresses or Usernames, "Need Admin Approval," Etc.Wondering how to get support for your community account? Check out the details on these common questions and more. Just follow the link below for articles that explain it all.Community Account Support - Power Platform Community (microsoft.com)   All About GDPR: How It Affects Closing Your Community Account (And Why You Should Think Twice Before You Do)GDPR, the General Data Protection Regulation (GDPR), took effect May 25th 2018. A European privacy law, GDPR imposes new rules on companies and other organizations offering goods and services to people in the European Union (EU), or that collect and analyze data tied to EU residents. GDPR applies no matter where you are located, and it affects what happens when you decide to close your account. Read the details here:All About GDPR - Power Platform Community (microsoft.com)   Getting to Know You: Setting Up Your Community Profile, Customizing Your Profile, and More.Your community profile helps other members of the community get to know you as you begin to engage and interact. Your profile is a mirror of your activity in the community. Find out how to set it up, change your avatar, adjust your time zone, and more. Click on the link below to find out how:Community Profile, Time Zone, Picture (Avatar) & D... - Power Platform Community (microsoft.com)   That's it for this week. Tune in for more Tuesday Tips next Tuesday and join the community as we get "Back to Basics."

Announcing the MPPC's Got Power Talent Show at #MPPC23

Are you attending the Microsoft Power Platform Conference 2023 in Las Vegas? If so, we invite you to join us for the MPPC's Got Power Talent Show!      Our talent show is more than a show—it's a grand celebration of connection, inspiration, and shared journeys. Through stories, skills, and collective experiences, we come together to uplift, inspire, and revel in the magic of our community's diverse talents. This year, our talent event promises to be an unforgettable experience, echoing louder and brighter than anything you've seen before.    We're casting a wider net with three captivating categories:  Demo Technical Solutions: Show us your Power Platform innovations, be it apps, flows, chatbots, websites or dashboards... Storytelling: Share tales of your journey with Power Platform. Hidden Talents: Unveil your creative side—be it dancing, singing, rapping, poetry, or comedy. Let your talent shine!    Got That Special Spark? A Story That Demands to Be Heard? Your moment is now!  Sign up to Showcase Your Brilliance: https://aka.ms/MPPCGotPowerSignUp  Deadline for submissions: Thursday, Sept 28th    How It Works:  Submit this form to sign up: https://aka.ms/MPPCGotPowerSignUp  We'll contact you if you're selected. Get ready to be onstage!  The Spotlight is Yours: Each participant has 3-5 minutes to shine, with insightful commentary from our panel of judges. We’re not just giving you a stage; we’re handing you the platform to make your mark.     Be the Story We Tell: Your talents and narratives will not just entertain but inspire, serving as the bedrock for our community’s future stories and successes.    Celebration, Surprises, and Connections: As the curtain falls, the excitement continues! Await surprise awards and seize the chance to mingle with industry experts, Microsoft Power Platform leaders, and community luminaries. It's not just a show; it's an opportunity to forge connections and celebrate shared successes.    Event Details:  Date and Time: Wed Oct 4th, 6:30-9:00PM   Location: MPPC23 at the MGM Grand, Las Vegas, NV, USA  

A Celebration of What We've Achieved--And Announcing Our Winners

As the sun sets on the #SummerofSolutions Challenge, it's time to reflect and celebrate! The journey we embarked upon together was not just about providing answers – it was about fostering a sense of community, encouraging collaboration, and unlocking the true potential of the Power Platform tools.   From the initial announcement to the final week's push, the Summer of Solutions Challenge has been a whirlwind of engagement and growth. It was a call to action for every member of our Power Platform community, urging them to contribute their expertise, engage in discussions, and elevate collective knowledge across the community as part of the low-code revolution.   Reflecting on the Impact As the challenge ends, it's essential to reflect on the impact it’s had across our Power Platform communities: Community Resilience: The challenge demonstrated the resilience of our community. Despite geographical distances and diverse backgrounds, we came together to contribute, learn, and collaborate. This resilience is the cornerstone of our collective strength.Diverse Expertise: The solutions shared during the challenge underscore the incredible expertise within our community. From intricate technical insights to creative problem-solving, our members showcased their diverse skill sets, enhancing our community's depth.Shared Learning: Solutions spurred shared learning. They provided opportunities for members to grasp new concepts, expand their horizons, and uncover the Power Platform tools' untapped potential. This learning ripple effect will continue to shape our growth. Empowerment: Solutions empowered community members. They validated their knowledge, boosted their confidence, and highlighted their contributions. Each solution shared was a step towards personal and communal empowerment. We are proud and thankful as we conclude the Summer of Solutions Challenge. The challenge showed the potential of teamwork, the benefit of knowledge-sharing, and the resilience of our Power Platform community. The solutions offered by each member are more than just answers; they are the expression of our shared commitment to innovation, growth, and progress!       Drum roll, Please... And now, without further ado, it's time to announce the winners who have risen above the rest in the Summer of Solutions Challenge!   These are the top community users and Super Users who have not only earned recognition but have become beacons of inspiration for us all.   Power Apps Community:  Community User Winner: @SpongYe Super User Winner: Pending Acceptance Power Automate Community:  Community User Winner: @trice602 Super User Winner: @Expiscornovus  Power Virtual Agents Community: Community User Winner: Pending AcceptanceSuper User: Pending Acceptance Power Pages Community: Community User Winner: @OOlashyn Super User Winner: @ChristianAbata   We are also pleased to announced two additional tickets that we are awarding to the Overall Top Solution providers in the following communities:    Power Apps: @LaurensM   Power Automate: @ManishSolanki    Thank you for making this challenge a resounding success. Your participation has reaffirmed the strength of our community and the boundless potential that lies within each of us. Let's keep the spirit of collaboration alive as we continue on this incredible journey in Power Platform together.Winners, we will see you in Vegas! Every other amazing solutions superstar, we will see you in the Community!Congratulations, everyone!

Users online (2,995)