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 Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,510)