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

Length function returning incorrect value

Hi All


I've been bashing my head against the wall trying to figure out why a length function was failing to pick up the variables with a particular number of characters. I decided to test it in a much more basic flow as below

JamesMoyle_0-1634149999863.png

 

Now I've got all my fingers and thumbs, so I didn't need to take my socks off for this one, and that looks like eight to me. So why is the result 10 (below)?? I'm pretty new to this, so I am sure that this is worth a few eye rolls 🙂

 

JamesMoyle_1-1634150055873.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

It is returning the correct value. You are getting the length of the static string Get_DTENDa which is exactly 10 chaacters. You need to use length(variables('Get_DTENDa')) - that should return the value you expect.

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

View solution in original post

5 REPLIES 5
Paulie78
Super User
Super User

It is returning the correct value. You are getting the length of the static string Get_DTENDa which is exactly 10 chaacters. You need to use length(variables('Get_DTENDa')) - that should return the value you expect.

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

CFernandes
Super User
Super User

Hey @JamesMoyle 

 

Editing my Answer as @Paulie78 saw something I and you missed 🙂

 

You formula should be - 

length(variables('CheckLEnght'))

 

Please mark @Paulie78 Correct.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

That makes sense - but now it is saying 

The inputs of workflow run action 'Compose' of type 'Compose' are not valid. The variable 'Get_DTENDa' must be initialized before it can be used inside action 'Compose'.
Didn't I initialize the variable in the previous action?
Paulie78
Super User
Super User

My error, the variable name you created is called Date.

Thank you - this has created even more questions for me, but you have more than generous already and this has been really helpful to understand the logic of what's going on!

Helpful resources

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

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,336)