Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Flow Fails At Condition even though I have 3 parameters

(0) ShareShare
ReportReport
Posted on by 41

Hi. I have a condition with 3 rows and it keeps saying I don't have enough parameters. Can this be fixed?

 

The condition expressions are:

 

if(isNumber(substring(triggerBody()?['Employee Department Number'],0,1)))
 
if(equals(length(substring(triggerBody()?['Employee Department Number'],0,1))),1,'false')
 
if(or(equals(substring(triggerBody()?['Employee Department Number'],0,1),'1'),equals(substring(triggerBody()?['Employee Department Number'],0,1),'2'),equals(substring(triggerBody()?['Employee Department Number'],0,1),'3'),equals(substring(triggerBody()?['Employee Department Number'],0,1),'4'),equals(substring(triggerBody()?['Employee Department Number'],0,1),'6'),equals(substring(triggerBody()?['Employee Department Number'],0,1),'7'),equals(substring(triggerBody()?['Employee Department Number'],0,1),'9')),true,false) 
 
 
Are these wrong or am I missing steps?
  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Flow Fails At Condition even though I have 3 parameters

    Is your output really a number? Otherwise you would have to convert it to a number using “int” or convert 661 to string using “string”.

  • MooseGooseLoose Profile Picture
    41 on at
    Re: Flow Fails At Condition even though I have 3 parameters

    My bad for not responding ( was on vacation for a week). What I'm trying to do with this flow is take a csv from Sharepoint, look at one column from said csv, filter out the rows in said column without the important 20 categories, count each row in the right category, make a table with the corrected count, and then upload the count back into the csv daily. I have the 1st third of making it into a JSON, but have fumbled the rest

     

    If you want specific example of what I want it to do, here's a simple visualization of me trying to find the count of one particular category

    Screenshot 2023-06-30 131915.png

  • Sundeep_Malik Profile Picture
    6,482 on at
    Re: Flow Fails At Condition even though I have 3 parameters

    @MooseGooseLoose 

     

    Can you give a scenario like what you have and what you want to achieve? Then I would be able to help you better. Like give me an example or a bunch of examples would help.

  • MooseGooseLoose Profile Picture
    41 on at
    Re: Flow Fails At Condition even though I have 3 parameters

    Thank you! I did use a lil bing chat which is why I got the isNumber, but I didn't know I wrote the other expressions wrong. That being said, what would be the expression to filter out non digit/integer/numbers?

  • Sundeep_Malik Profile Picture
    6,482 on at
    Re: Flow Fails At Condition even though I have 3 parameters

    Hey @MooseGooseLoose 

     

    Use the following expression to know what value is at 0th position in your employee department number:

     

    if(
    or(
    equals(substring(triggerBody()?['Employee Department Number'], 0, 1), '1'),
    equals(substring(triggerBody()?['Employee Department Number'], 0, 1), '2'),
    equals(substring(triggerBody()?['Employee Department Number'], 0, 1), '3'),
    equals(substring(triggerBody()?['Employee Department Number'], 0, 1), '4'),
    equals(substring(triggerBody()?['Employee Department Number'], 0, 1), '6'),
    equals(substring(triggerBody()?['Employee Department Number'], 0, 1), '7'),
    equals(substring(triggerBody()?['Employee Department Number'], 0, 1), '8'),
    equals(substring(triggerBody()?['Employee Department Number'], 0, 1), '9')
    ),
    true,
    false
    )

     

     

    Expression with startswith:

    if(
    or(
    startsWith(triggerBody()?['Employee Department Number'], '1'),
    startsWith(triggerBody()?['Employee Department Number'], '2'),
    startsWith(triggerBody()?['Employee Department Number'], '3'),
    startsWith(triggerBody()?['Employee Department Number'], '4'),
    startsWith(triggerBody()?['Employee Department Number'], '6'),
    startsWith(triggerBody()?['Employee Department Number'], '7'),
    startsWith(triggerBody()?['Employee Department Number'], '8'),
    startsWith(triggerBody()?['Employee Department Number'], '9')
    ),
    true,
    false
    )

     

     

    In your expressions, there are some mistakes.

     

    -> if(isNumber(substring(triggerBody()?['Employee Department Number'],0,1)))

    There is no number function in power automate. You have done the substring correctly but you have not given values if it is a number. Like if expects two parameters, if it is true what happens, if it is false what happens.

     

    -> if(equals(length(substring(triggerBody()?['Employee Department Number'],0,1))),1,'false')

    This expression looks better, but above you have made a mistake like, if it is equal to 1, you have provided false, but what happens if it is not equal to 1. You have given nothing. Thats why it is giving error.

     

     

    I hope this helps 🙂

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1