Get length DAC
The Get length dynamic advanced command is part of the variable commands. Use this command to count the number of characters (including spaces) in a text string stored within a variable and save the results in a new or existing variable. Drag it into a wizard from the Advanced commands view in the Nintex Wizard Editor to use it.
Before you begin:
Learn how to navigate the Nintex Wizard Editor of the Studio.
Understand how to create wizards and use advanced commands.
Understand variables.
Learn how to customize error handling within an advanced command.
Understand how to configure wizard fallbacks.
Use the Get length command when you need to determine the length of a text string stored in a variable. This command is useful for checking if text entries are the right length or for processing text in your wizards.
In the Nintex Wizard Editor, search for the Get length command and drag it into your steps. Use the table below to configure each field and understand the settings:
Field | Description | What to do |
---|---|---|
Get the length of the text stored in | The name of the variable containing the text whose length you want to count. | Enter the variable name that holds the text string. |
Return the result in variable | The name of the variable to store the length result. | Enter the name of the variable or select an existing one. |
Follow these best practices when using the Get length command:
-
Ensure that the variable containing the text is correctly populated before using the command.
-
Use descriptive names for your variables to make the automation process easier to understand and maintain.
This example shows how to validate that a username entered by a user meets a specific length requirement.
-
Add the Set value command to your wizard to store the username entered by the user into a variable
-
Add the Get length command and complete the following fields:
-
Get the length of the text stored in: UsernameVar
-
Return the result in variable: UsernameLength
-
-
Add the If else command and complete the following fields:
-
If: UsernameLength
-
Select is less than.
-
Enter 6.
-
-
Drag the Show message command into the Then: container of the If else command and enter a Message:
CopyYou must create a username with 6 or more characters.
-
Drag the Continue wizard command into the Else: container of the If else command.
-
Use the View variable list command to verify the command works as intended.