Wiki source code of Data type transformations

Last modified by Erik Bakker on 2023/01/24 15:10

Show last authors
1 {{container}}{{container layoutStyle="columns"}}(((
2 The data type (i.e. string, dateTime, boolean, integer, or decimal) of attributes can differ between the input definition and the target definition.
3 To ensure that you end up with a valid target message you will need a data type transformation to reach that goal.
4
5 In this microlearning, we will educate you on the possibility of data transformations in eMagiz.
6
7 Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]].
8
9 == 1. Prerequisites ==
10
11 * Basic knowledge of the eMagiz platform
12
13 == 2. Key concepts ==
14
15 This microlearning focuses on data type transformations.
16
17 With data type transformations we mean: Ensuring that the output is valid according to the data type of the attribute in the target message
18
19 == 3. Data type transformations ==
20
21 Several data type transformations could be done with eMagiz. In this microlearning, we will focus on the one that you will use the most.
22 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.
23
24 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-data-type-transformations--data-type-transformation-starting-point.png]]
25
26 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
27
28 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-data-type-transformations--data-type-transformation-pop-up.png]]
29
30 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
31
32 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-data-type-transformations--data-type-transformation-pop-up-convert-datatype.png]]
33
34 Now the only thing we need to know is how (in which notation) the backend operation of our API Gateway will return the Datum.
35
36 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.
37
38 [[image:Main.Images.Microlearning.WebHome@crashcourse-platform-create-data-type-transformations--data-type-transformation-pop-up-convert-datatype-filled-in.png]]
39
40 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.
41
42 So, remember to check for the option convert datatype when you have a mismatch in the datatype between input and output.
43
44 == 4. Key takeaways ==
45
46 * Data type transformation is to ensure that the output is valid according to the underlying rules of that data type
47 * eMagiz gives you the option to convert the datatype in most cases via the visual tooling
48 * Without knowing the input format it will be impossible to make a successful data type transformation
49
50 == 5. Suggested Additional Readings ==
51
52 If you are interested in this topic and want more information on it please read the help text provided by eMagiz.
53 )))((({{toc/}}))){{/container}}{{/container}}