makeData
  • 18 Oct 2024
  • Dark
    Light
  • PDF

makeData

  • Dark
    Light
  • PDF

Article summary

makeData Task Purpose

The makeData task is used to convert an input string into a different data type. The converted data types that are allowed include boolean, json, number, and string.

Potential Use Case

The makeData task is typically used in conjunction with another task that comes before it, as a way to convert incoming data into a format (type) that can be used in a following task. The makeData task can also be used independently, with the variables input used when a String is being converted. Using a variable is good for appending data that is coming from a previous task. In some of the examples below you will see how you can get the same result by using a variable or not using a variable.

Properties

Input and output parameters are shown below.

Incoming Type Description
input String Required. The input to be converted into a data type. Variables are wrapped with <!!>.
outputType Enum Required. The type of output. Allowed values are: boolean, json, number, string.
variables Object Optional. A key value object used in string interpolation; defined when the <!!> variable syntax is used within the input parameter.


Outgoing Type Description
output Boolean
Json
Number
String
The converted data that is returned.

Example 1

In this example data will be converted to a string.

  • The input Reference variable is the string Who are you <!var1!>.

  • The outputType will be a string.

  • The variables object for the wrapped variable <!var1!> is defined as "I'm Batman".

    ex01-makeData

  • The output that returns will be a string that combines the <!var1!>, which is "Who are you", with the variable "I'm Batman".

    ex02-makeData

Example 2

In this example data will be converted to a json.

  • The input string is {"name"."<!var1!>","last":"Wayne"}.

  • The outputType will be a json.

  • The variables object is {"var1".Bruce"}

    ex03-makeData

  • Alternatively you can use {"name":"Bruce","last":"Wayne"} as the input string with no defined variables object.

    ex04-makeData

  • The output for both variable use and non-variable use is the same and shown as a json of name/value pairs {"name":"Bruce","last":"Wayne"}.

    ex05-makeData

Example 3

In this example data will be converted to a number.

  • The input variable is defined as <!var!>, and the outputType will convert the data to a number.

  • The variables object is {"var1"."42"}, with the number 42 in the key-value.

    ex06-makeData

  • Alternatively, the non-variable input can use the number 42 outright.

    ex07-makeData

  • The output for both (variable and non-variable) will convert the incoming data to a number that will be shown as 42.

    ex08-makeData

Example 4

In this example we will change the data to a boolean.

  • The input variable is defined as <!boolean!>.

  • The outputType will be a boolean.

  • The variables object used to showcase the result for this task is {"boolean":true}.

    ex09-makeData

  • The output that returns from running this task will be True.

    ex10-makeData


Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.