Conversion

This content applies to legacy design tools (such as K2 Studio, K2 for Visual Studio, or the Silverlight-based K2 workflow design tool). If you have upgraded from K2 blackpearl 4.7 to K2 Five, these tools may still be available in your environment. These legacy tools may not be available in new installations of K2 Five. These legacy tools may also not be available, supported, or behave as described, in future updates or versions of K2. Please see the legacy component support policy for more information about support for these components.

Note that the success of a conversion depends on the data itself and not only on the input type. For example, converting a long data type to a short works as long as the data itself is convertible, i.e. the number of bits is 16 or less. Converting a decimal to Boolean works as long as the decimal number is 1.0 or 0.0.

Boolean can be converted from a number, where 1 is true and 0 is false.

Function Accepted input types
To Binary String (Base-64)
To Boolean String, Byte, Short, Integer, Long, Double, Decimal, Boolean
To Bytes String
To DateTime String
To Decimal String, Byte, Short, Integer, Long, Double, Decimal, Boolean
To Double String, Byte, Short, Integer, Long, Double, Decimal, Boolean
To Integer String, Byte, Short, Integer, Long, Double, Decimal, Boolean
To Long String, Byte, Short, Integer, Long, Double, Decimal, Boolean
To Short String, Byte, Short, Integer, Long, Double, Decimal, Boolean
To String String, Byte, List of Byte, Short, Integer, Long, Double, Decimal, Boolean
To K2 FQN User String, String[]
To SharePoint Claims User String, String[]

An item is selected and then added to the canvas or K2 field part by clicking the Add button, or by dragging it to the right place.

Functions Description Example
To Base-64 String Converts an array of bytes to a base-64 encoded string Input Value: { 69, 120, 97, 109, 112, 108, 101 }
Result: "RXhhbXBsZQ=="
To Binary Converts a base-64 encoded string to an array of bytes. Input Value: "RXhhbXBsZQ=="
Result: { 69, 120, 97, 109, 112, 108, 101 }
To Boolean Converts a value to a Boolean data type. Input Value: "True"
Result: True
To Bytes Converts a string to an array of bytes using the default character encoding. Input Value: "Example"
Result: { 69, 120, 97, 109, 112, 108, 101 }
To Date Time Converts a value to a DateTime data type. InputValue: "2009/02/02 05:05:05 AM"
Result: 2009/02/02 05:05:05 AM
To Decimal Converts a value to a Decimal Data type. Input Value: "1"
Result: 1.0
To Double Converts a value to a Double data type. Input Value: "1"
Result: 1.0
To Integer Converts a value to an Integer data type. Input Value: "1.0"
Result: 1
To Long Converts a value to a Long data type. Input Value: "1.0"
Result: 1
To Short Converts a value to a Short data type. Input Value: "1.0"
Result: 1
To String Converts a value to a String data type. Example 1:
Input Value: 12345
Result: "12345"
Example 2:
Input Value: { 69, 120, 97, 109, 112, 108, 101 }
Result: "Example"
To K2 FQN User Converts an encoded SharePoint claims user or group to K2 FQN user or group.

Example 1:
Input Value: c:0-.f|ldaproleprovider|legal
Result: K2LDAP:legal

Example 2:
Input Value: c:0-.f|ldaproleprovider|legal;i:0#.f|ldapmembershipprovider|holly

Result: K2LDAP:joe;K2LDAP:holly

To SharePoint Claims User Converts a K2 FQN user or group to an encoded SharePoint claims user or group. Example 1:
Input Value: c:0-.f|ldaproleprovider|legal
Result: K2LDAP:legal
Example 2:
Input Value: c:0-.f|ldaproleprovider|legal;i:0#.f|ldapmembershipprovider|holly
Result: K2LDAP:joe;K2LDAP:holly

The Function Wizard varies based on the function: