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 / 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,443 Super User 2025 Season 2 on at
    There is no operator ">" in Power Automate expressions.
    Check function greater()
  • Verified answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 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

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard