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 Apps / Left formula error...s...
Power Apps
Answered

Left formula error...sometimes!

(0) ShareShare
ReportReport
Posted on by 347
Hi all,
 
This has my head scratching and need bigger brains to help!
 
I have a Sharepoint list as source and one field is a choice field with the ability to select multiple options. To display the selected options in a gallery I've used this formula, on occasion I get an error (which also shows in live) "The Second argument to the 'Left' function is invalid". Sometime the error it shows in the gallery and sometimes not. If there is no value in the field would that cause and error?
 
Left(Concat(ThisItem.'Division Impact'.Value, Value & ", "), Len(Concat(ThisItem.'Division Impact'.Value, Value & ", "))-2)
 
 
With thanks
Neil
Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    on at
    Yes, you are correct - if there are no values, then the Concat expression would return an empty text, so the second argument to the Left function would be -2 (which is invalid).
     
    You can use the third argument to the Concat function to pass the separator, this way you won't need to calculate the length to remove the last ', ' instance:
    Concat(ThisItem.'Division Impact', Value, ", ")
    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

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard