Convert Value
Interprets a provided text value and stores the interpreted form in a workflow variable of a different type. For example, interprets the value in a text variable as a number and stores the value in a number variable.
With this action you can extract numerical data from text strings, such as query results. This extraction is useful when you want to perform logical operations on the data, such as comparing the extracted value to a baseline value.
For example, Alex needs to route budget requests for approval if the amount is greater than $10,000. Employees submit budget requests using an InfoPath form, with resulting data stored as XML format in InfoPath documents within in a SharePoint document library. Alex designs a workflow to extract the requested budget amount by XPath node, using the workflow action Query XML. Because the amount is returned as text, Alex uses the workflow action Convert Value to convert the text value to a numerical value (stored in a Number variable). The workflow action Run if assigns a task for approval if the numerical value is greater than the baseline value of $10,000 (10000).
In this scenario, Alex also wants to determine how long ago requests were submitted. Alex uses the workflow action Convert Value to convert the extracted submission date from text format to date/time format (stored in a Date/Time variable), then uses the workflow action Find Interval Between Dates to calculate the difference between the submission date and the current date.
Action settings
Do one of the following to open the Action configuration window:
- Double-click the action.
- Click on the action and then click Configure.
See Action configuration window for more information.
Field | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Input string |
The value that is to be interpreted. The specified value must be a datetime string if a Date/Time variable is selected for Store result in. Datetime string formats and examples
Note: For time accuracy, include timezone offset for daylight savings where applicable. For example, England observes British Summer Time (BST) from late March to late October. A datetime string for this area and during this time range should therefore include an additional time offset of an hour (+01:00). |
||||||||||||
Input regional settings |
(Optional.) The language and country/region for conversion of the input string into another variable type. For example, if the provided input string contains a number in a European format, select a European language such as German (Liechtenstein) to ensure that the value of the input string is interpreted correctly. Select Invariant to specify an invariant language. When Default is selected, the current language settings of the SharePoint site are used. |
||||||||||||
Convert string to and store in | The variable to store the resulting value. If the input text cannot be converted into a value that is compatible with the selected variable, the workflow will error. | ||||||||||||
Input date/time format |
(Optional. Displayed when a Date/Time variable is selected for Convert string to and store in.) The exact date and time format that the input string must match. When a format is selected, the input string is recognized only when it is an exact match to the selected format. For recognized date and time formats, see the Microsoft article Custom Date and Time Format Strings. |