Help Desk

Submit a ticket My Tickets

Variable Transformation

How to Transform Variables

OneCloud can transform data to conform to the format that is needed within your chains. The following variable and data types can be used in variable transformations:

Variable Types:

Data Types:

  • String
  • Date
  • JSON

Depending on the data variable type, the following operations are supported:

OperationData TypeDescription
LowercaseStringConvert a string to lowercase
UppercaseStringConvert a string to uppercase


Returns a text value with the leading and trailing spaces removed


Returns a text value with the leading spaces removed


Returns a text value with the trailing spaces removed
Replaces a string
Splits a string


Capitalizes the entire string


Capitalizes the first letter of all individual words in a string


Adds spaces to the left of the string


Adds spaces to the right of the string
Parse Text as JSONStringConvert text formatted as JSON to a proper JSON output for use in subsequent OneCloud Commands
Date & Time FormatString Date/TimeFormat Date/DateTime strings
Date MathString Date/TimeAdd/subtract time units from a Date/DateTime
SortListSort a list based in ascending or descending order
Pick from ListListPick an individual element from a list. (0 for the first and -1 for the last element)
JSON ParsingJSONPick individual elements from a proper JSON text string

String Transformation

String transformation enables any variable that is of data type string to be transformed to upper or lower case as well as parsed and converted to a JSON data type. To start a transformation, select the variables and select the required transformation.


Date Transformation

Data transformation allows Date/DateTime strings to be transformed into various formats based upon strftime formatting symbols. For a comprehensive description of the format specifier, please refer to this strftime format guide. These formatting characters can then be combined with other separator characters such as the following characters: , : / . 

The following table illustrates various format strings and the corresponding format.


Using Date Transformation with OneCloud System Date/Time

If using OneCloud System Variable, Chain Execution Date & Time, the Input Date Time Zone should be (UTC) Dublin, Edinburgh, Lisbon, London, since this reflects OneCloud's base timezone.


Date Math

Date math transformations enable timestamps to be added or subtracted based upon the following parameters:

ISO extended or custom date format
Add/ Subtract
Numeric value
  • Day
  • Month
  • Year
  • Hour
  • Minute


List Transformation

Lists can be sorted in ascending or descending order, and specific elements can be extracted from a list. In the example below, the first Command lists the files in a directory, and the list output from the first Command is first sorted, and then the first value of that list is extracted.

List Output

List transformation will only operate with Command outputs of the type 'List'.


JSON Transformation

Many public Rest APIs provide responses in a JSON format. The data in the response can be transformed and used within your chain. There are a few simple things to remember when using JSON transformations: 

  1. Elements in a list within JSON use zero-based indexing (this first element is at the zero index)
  2. Reference the element name on the left
  3. Match the element type (string, list, or JSON)


	"email": "",
	"decision": "rejected",
	"decidedAt": "2019-01-13T22:59:52.018377",
	"comment": "Please review again"
}, {
	"email": "",
	"decision": "approved",
	"decidedAt": "2020-01-13T22:59:52.018377",
	"comment": "Looks great!"

The example JSON above is a response from OneCloud Human Integration Workflow. If the second decision element is in the list to be selected, then a transformation would be added as follows:

  1. Add a variable transformation on a variable that holds JSON (see example JSON above).
  2. Add the first transformation `Parse Text as JSON`
  3. Add the second transformation `Get Value from JSON` and select the elements in the array.


What's Next?

Learn about Trigger Events.

Brian is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.