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...

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (3,263)