K2 BLACKPEARL PRODUCT DOCUMENTATION: USER GUIDE
Conversion

Inline Functions - Conversion

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 will work as long as the data itself is convertible, i.e. a number of 16 bits or less. Converting a Decimal to Boolean will only work if the decimal number is 1.0 or 0.0.

Boolean can be converted from a number, where 1 equals True and 0 equals 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 using drag-and-drop.

Fig. 1. Conversion

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 content varies according to the selected function:

 

 


K2 blackpearl Help 4.6.11 (4.12060.1731.0)