cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

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
Super User
Super User

Hi @nsilv_le 

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
Super User
Super User

Hi @nsilv_le 

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (77,067)