How to test the length of a string in Workflow Designer
I have been programming for nearly 20 years, but I cannot figure out how to simply test the length of a string variable in Workflow Designer. The variable I have is named sManholeID. It has to be 6 characters long before the workflow continues. Therefore, I am trying to set the Condition property in an If activity. I have tried calling Len(sManholeID), Length(sManholeID), Strings.Len(sManholeID), sManholeID.Len(), sManholeID.len(), etc. and the Expression Editor isn't happy. For equality to 6, I have tried single equal signs, double equal signs, grouping parentheses, etc. I'm embarrassed to say that I'm stumped on this very simple expression. Can you help me?
0
-
Hi Roger, try sManholeID.Length()
Xaml workflows use VB.Net - if you add "VB.Net" to to a Google search, you can usually find expressions that will work for Workflow. Eg, "string length VB.Net" gets good Google results for this question.0 -
And use the Intellisense feature.
https://docs.geocortex.com/essentials/workflow/latest/help/Default.htm#wf/help/arguments-and-variables.htm#IntelliSense%3FTocPath%3DArguments%2520and%2520Variables%7C_____5
Your expression should be something likesManholeID.Length = 60 -
Thank you both. I had been searching the internet for how to do this in VBScript, not VB.Net, so your tip was very helpful. I had also not known about Intellisense. I had definitely tried pressing Ctrl+Space, without knowing I had to enable something first. As far as my question goes, there are two expressions that worked as Conditions:
sManholeID.Length() = 6
and
sManholeID.Length = 6
"Roj"0
Please sign in to leave a comment.
Comments
3 comments