web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Syntax errror in if fu...
Power Automate
Unanswered

Syntax errror in if function

(0) ShareShare
ReportReport
Posted on by 2,295

Hello,

 

Can someone please explain what is wrong with this function?

 

 

if(length(variables('Eventos')) > 0, 1, 0)

 

 

All I get is:

 

 

The expression is invalid.

 

 

The expression:

length(variables('Eventos'))

 

Works well, ie, counts the elements of an array.

 

Thank you

Categories:
I have the same question (0)
  • Verified answer
    ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    hi @WebPortal  this is because power automate don't understand > you need to change it by greater or less o equals

     

    see

     

    if(greater(length(variables('Eventos')),0), 1, 0)

  • fchopo Profile Picture
    8,003 Moderator on at

    Hello @WebPortal 

    Try this:

    if(greater(length(variables('Eventos')),0),1,0)

     

    Hope it helps!

    Ferran 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard