Skip to main content

Notifications

Copilot Studio - General
Answered

How to check if results is more when results is more than one

Posted on by 72

I am using an Excel to extract the results from the question. I will be using a compose action with the expression split("Yourtext",",") using the separator. So the result you will have separated data in an array variable instead of all the results combining into 1 string. How do I check if there are more than 1 results because if there are more than 1 results, I will need to send a msg to user to either refine the question or send e-mail to group for help.  Appreciate any guidance in advance.

 

Thanks,

  • Expiscornovus Profile Picture
    Expiscornovus 29,332 on at
    Re: How to check if results is more when results is more than one

    Hi @Tak103,

     

    I don't see a screenshot. Can you try and attach it again to your post?

  • Tak103 Profile Picture
    Tak103 72 on at
    Re: How to check if results is more when results is more than one

    Thanks.  I am totally new to this so much appreciate it.

  • Expiscornovus Profile Picture
    Expiscornovus 29,332 on at
    Re: How to check if results is more when results is more than one

    Hi @Tak103,

     

    That is why I suggested to use a length function, this type of function can count the number of items in an array. It doesn't matter how much items there are in that array, it will just output a number.

     

    When the array has 3 items it will output 3. When it has 10 items it will output 10 as a result.

     

    Can you share a screenshot of your current setup? I can adapt my previous example to your setup 😀

  • Verified answer
    Tak103 Profile Picture
    Tak103 72 on at
    Re: How to check if results is more when results is more than one

    Unfortunate, the answer length can vary. If I were to use split("Yourtext",",") using the separator to separate the results in an array variable. Will I be able to count how many is in the array variable? If this is a sound approach, would you be able to share with me how I can do this.

     

    Thanks,

  • Expiscornovus Profile Picture
    Expiscornovus 29,332 on at
    Re: How to check if results is more when results is more than one

    Hi @Tak103,

     

    You could use a length function in an expression to check the outputs of your compose action:

    length(outputs('Compose'))

     

    The expression could be used in a condition action with an operator like is greater than 1.

     

    lengthoutputscompose.png

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,030

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,085

Leaderboard