cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Determine Length of a Tweet

Hi Community Team, 

 

How do I determine the length of a tweet? I am using an if statement to determine if the length of a tweet is less than 255 then return the length of the tweet if its more than 254 then return 254. I am currently getting an invalid expression error. What am I missing? 

 

if(greater(length(string(triggerBody()?['TweetText'])),254),254,(length(string(triggerBody()?['TweetText'])))

 

Kind Regards, 

Nathaniel

1 ACCEPTED SOLUTION

Accepted Solutions
sudharsan1985
Solution Sage
Solution Sage

Hi @Anonymous 

Your expression missed few closing braces, here is the correct expression.

if(greater(length(string(triggerBody() ? ['TweetText'])), 254), 254length(string(triggerBody() ? ['TweetText'])))
 
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

1 REPLY 1
sudharsan1985
Solution Sage
Solution Sage

Hi @Anonymous 

Your expression missed few closing braces, here is the correct expression.

if(greater(length(string(triggerBody() ? ['TweetText'])), 254), 254length(string(triggerBody() ? ['TweetText'])))
 
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...
Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,587)