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 😘

View solution in original post

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

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,493)