Extract numeric values DAC
The Extract numeric values dynamic advanced command is part of the variable commands. Use this command to retrieve all numeric values from a given text and store them in a 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 Extract numeric values command to enhance your automation in various scenarios:
-
Extract numeric data from a text string.
-
Filter out non-numeric characters from input data.
-
Prepare numerical data for further processing or calculations.
The Extract numeric values command identifies and extracts numbers from text by recognizing specific characters within a data string. For a number to be properly identified, it must either be enclosed in quotes (single or double) or separated from surrounding text by one of the following characters, which help the wizard recognize numbers as separate from each other:
-
<Space>
-
Comma ( , ) *See Considerations for details on how commas are handled.
-
Semicolon ( ; )
-
Pipe ( | )
In the Nintex Wizard Editor, search for the Extract numeric values 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 all numeric values | The variable that contains the text from which you want to extract numbers. | Enter the name of the variable from which you want to extract the numbers. |
Preserve original number formats | Option to keep the original number formats in the output. This command treats numbers immediately preceded by a currency symbol (e.g., $, €, £, ¥) as numeric values. If there is no space between the currency symbol and the number, the output will include the currency symbol. See Consideration. |
Check this box if you want to preserve the formats of the numbers from the original variable. |
Delimiter | The character used to separate the extracted numbers in the output. A delimiter is a character that marks the boundary between separate, distinct values (e.g., ; or ,). |
Enter the delimiter you’d like to use to separate the extracted numbers. *See Considerations for details on supported delimiters. |
Return the results | The name of the variable to store the extracted numbers. | Enter the name of the variable to store the extracted numbers. Use a descriptive variable name (e.g., dailySalesNumeric). |
Numeric extractor tester... | The tool that tests whether the numbers are extracted from the text as expected. | Click the Numeric extractor tester... link to test the extraction with sample data. |
Error handling | Instructions on how the wizard should manage errors during extraction. | Expand the Error handling option to assign an error variable. |
The Numeric values tester allows you to test the extraction of numeric values from text before implementing the command in a workflow. It's recommended for verifying the correct extraction of numbers from specific text files. You can access this tool within the Extract numeric values command by clicking the Numeric extractor tester... link, as shown in the Command setup.
Field | Description | What to do |
---|---|---|
Enter text | The text box where you input the text containing numbers to be extracted. | Type or paste the text containing numbers into the text box. |
Load text file... | The option to load a text file from your local machine. | Click Load text file... and select the file you want to test. |
Preserve original number formats | Option to keep the original number formats in the output. This command treats numbers immediately preceded by a currency symbol (e.g., $, €, £, ¥) as numeric values. If there is no space between the currency symbol and the number, the output will include the currency symbol. |
Check this box if you want to keep the original formatting of the numbers as they appear in the text. |
Delimiter | The character used to separate the extracted numbers in the output. A delimiter is a character that marks the boundary between separate, distinct values (e.g., ; or ,). |
Enter the delimiter you’d like to use to separate the extracted numbers. *See Considerations for details on supported delimiters. |
Extract numbers | The button to start the extraction process. | Click Extract numbers to see the extracted numbers in the Result field. |
Result | Displays the extracted numbers based on the provided text and delimiter settings. |
Review the Result field to ensure the extracted numbers match your expectations. Test multiple text files, one at a time, to ensure correct number extraction before finalizing your workflow. |
Follow these best practices when using the Extract numeric values command:
-
Ensure the source text contains numeric values for meaningful extraction.
-
Use clear and descriptive variable names for the result to avoid confusion in complex automations.
-
To ensure numbers are extracted as expected, use the Numeric extractor tester... link within the command to test with sample data.
This example shows how to identify and extract the stock numbers, prices, and quantities from a report.
-
Add the Set value command to your wizard to define a variable with the text file.
Copydaily items orderedItem Description, Stock Number, Unit Price, Quantity Ordered
Tennis Racquet, 6527895, $65.00, 10
Tennis Shoes, 6387429, $89.50, 15
Tennis Balls, 6572369, $0.85, 90
Tennis Shorts, 6354789, $14.00, 20 -
Add the Extract numeric values command and complete the following fields:
-
Get all numeric values: $daily items ordered$
-
Delimiter: ; (semicolon)
-
Return the results: daily items numeric
-
-
Add the View variable list command to verify the command works as intended.
When using the Extract numeric values command, be aware of the following limitations:
-
Numbers preceded by certain symbols or characters (e.g., #, _) are not recognized as numeric values. To extract these numbers, you need to add a space before the symbol or character. Currency symbols (e.g., $, €, £, ¥) will work without a space.
-
If the command is not working as expected, you may need to update your DACs to the latest version. To ensure proper functionality, download and install the latest version of the DACs.
-
If a number contains a comma (e.g., 15,242), the command will treat the parts before and after the comma as separate numbers. For instance, 15,242 will be split and extracted as 15 and 242. If you use a delimiter like ;, the results would be, 15;242. If you want the number to be extracted as a single value, you need to remove the comma or format the number differently before using the command.
-
The command supports a wide range of characters as delimiters, including all letters of the alphabet (uppercase and lowercase), common punctuation marks, and special characters. For example:
-
Alphabetical characters: A, b, C, etc.
-
Punctuation marks: ,, ;, |, .
-
Special characters: @, !, #, $, %, ^, &, *, (, ), _, -, =, +, \t (for the tab character, note that you need to write it as \t, pressing the Tab key will not work).
-
-
The command will extract numbers with decimals only if the decimal is within the number (e.g., 123.45). It will not recognize numbers that start or end with a decimal (e.g., .234 or 240.48.).