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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / what's wrong with this...
Power Automate
Answered

what's wrong with this if statement....

(0) ShareShare
ReportReport
Posted on by 678

I'm using modern designer and it's saying there's an error in my format.

On the prev action I split a string based on a "space"
This action is called "SplitName"

split(item()?['name'],' ')

I then am inserting into a string DV field...trying to use...

if(length(outputs('SplitName')) > 1, outputs('SplitName')[1],'')

pretty basic stuff...the error is ... This expression has a problem. You can fix it manually or with Copilot.

it would accept length(outputs('SplitName')) but I'm throwing a conditional if in there... basically grab the 2nd item in the array if there's a value.

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,685 Super User 2026 Season 1 on at
    There is no operator ">" in Power Automate expressions.
    Check function greater()
  • Verified answer
    David_MA Profile Picture
    14,360 Super User 2026 Season 1 on at
    The issue is with the ">" character in the expression. That is not valid. I am going by memory and haven't tested this, but the correct expression should be: if(isgreater(length(outputs('SplitName')), 1), outputs('SplitName')[1], '')
     
    You need to use isgreater instead of >
  • Suggested answer
    sasrsc Profile Picture
    678 on at
    The final syntax for the record was...

    if(greater(length(outputs('SplitName')), 1), outputs('SplitName')[1], '')

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard