Data type transformations

Last modified by Erik Bakker on 2024/09/03 10:15

In this microlearning, we'll cover the essentials of data type transformations in eMagiz. When the data types of attributes differ between input and target definitions, you need to ensure a smooth conversion to maintain a valid target message. We'll focus on transforming data from string to date/time, a common task in eMagiz. By the end of this guide, you’ll know how to handle data type mismatches effectively.

Should you have any questions, please contact academy@emagiz.com.

1. Prerequisites

  • Basic knowledge of the eMagiz platform

2. Key concepts

This microlearning focuses on data type transformations.

With data type transformations we mean: Ensuring that the output is valid according to the data type of the attribute in the target message

3. Data type transformations

Several data type transformations could be done with eMagiz. In this microlearning, we will focus on the one that you will use the most.
Transforming from a string to a date(Time). To illustrate this point I made a new mapping in Design, this time one for an API Gateway flow.

crashcourse-platform-create-data-type-transformations--data-type-transformation-starting-point.png

As we talk about a transformation we need to select the transformation icon (the blue rectangle, remember). This will lead us to the following pop-up

crashcourse-platform-create-data-type-transformations--data-type-transformation-pop-up.png

In this pop-up, we have the option to convert the datatype. As the name suggests, this is the option we want to use this time

crashcourse-platform-create-data-type-transformations--data-type-transformation-pop-up-convert-datatype.png

Now the only thing we need to know is how (in which notation) the backend operation of our API Gateway will return the Datum.

In this case, the dates they return are formatted as dd-MM-yyyy. So let's alter the input format in eMagiz to represent that.

crashcourse-platform-create-data-type-transformations--data-type-transformation-pop-up-convert-datatype-filled-in.png

Save your solution and you will notice that the warning is gone from eMagiz as you have successfully transformed the content of Datum to a valid date.

So, remember to check for the option convert datatype when you have a mismatch in the datatype between input and output.

4. Key takeaways

  • Data type transformation is to ensure that the output is valid according to the underlying rules of that data type
  • eMagiz gives you the option to convert the datatype in most cases via the visual tooling
  • Without knowing the input format it will be impossible to make a successful data type transformation

5. Suggested Additional Readings

If you are interested in this topic and want more information on it please read the help text provided by eMagiz and read the following links: