You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/logic-apps/create-maps-data-transformation-visual-studio-code.md
+85-29Lines changed: 85 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,9 +45,9 @@ The Data Mapper extension currently works only with schemas in flat folder-struc
45
45
46
46
-[Same prerequisites for using Visual Studio Code and the Azure Logic Apps (Standard) extension](create-single-tenant-workflows-visual-studio-code.md#prerequisites) to create Standard logic app workflows.
47
47
48
-
- The latest Data Mapper extension for Visual Studio Code
48
+
- The latest **Azure Logic Apps - Data Mapper** extension. You can download and install this extension from inside Visual Studio Code through the Marketplace, or you can find this extension externally on the [Marketplace website](https://marketplace.visualstudio.com/vscode).
49
49
50
-
- The source and target schema files that describe the data to transform. These files can have either the following formats:
50
+
- The source and target schema files that describe the data types to transform. These files can have either the following formats:
51
51
52
52
- An XML schema definition file with the .xsd file extension
53
53
- A JavaScript Object Notation file with the .json file extension
@@ -60,14 +60,6 @@ The Data Mapper extension currently works only with schemas in flat folder-struc
60
60
61
61
- Sample input data if you want to test the map and check that the transformation works as you expect.
62
62
63
-
## Add source and target schemas to your project folder
64
-
65
-
1. Go to your local project folder, and expand the **Artifacts** > **Schemas** folder.
66
-
67
-
1. Add your source and target schema files to the **Schemas** folder.
68
-
69
-
In Visual Studio Code, these schema files now also appear in your logic app project.
70
-
71
63
## Create a data map
72
64
73
65
1. On the Visual Studio Code left menu, select the **Azure** icon.
@@ -76,21 +68,59 @@ The Data Mapper extension currently works only with schemas in flat folder-struc
76
68
77
69
1. Provide a name for your data map.
78
70
79
-
1. Specify your source schema:
71
+
1. Specify your source and target schemas by following these steps:
80
72
81
73
1. On the map surface, select **Add a source schema**.
82
-
1. On the **Configure** pane that opens, select **Select existing**, if not already selected.
83
-
1. From the source schema list, select your source schema, and then select **Add**.
84
74
85
-
The map surface now shows the data fields from the source schema.
75
+
1. On the **Configure** pane that opens, select **Add new** > **Browse**.
86
76
87
-
1. Specify your target schema:
77
+
1. Find and select your source schema file, and then select **Add**.
78
+
79
+
[!NOTE]
80
+
>
81
+
> If your source schema doesn't appear in the **Open** window,
82
+
> from the file type list, change **XSD File (\*.xsd)** to **All Files (\*.\*)**.
83
+
84
+
The map surface now shows the data types from the source schema.
88
85
89
86
1. On the map surface, select **Add a target schema**.
90
-
1. On the **Configure** pane that opens, select **Select existing**, if not already selected.
91
-
1. From the target schema list, select your target schema, and then select **Add**.
92
87
93
-
The map surface now shows data fields from the target schema.
88
+
1. On the **Configure** pane that opens, select **Add new** > **Browse**.
89
+
90
+
1. Find and select your target schema file, and then select **Add**.
91
+
92
+
[!NOTE]
93
+
>
94
+
> If your target schema doesn't appear in the **Open** window,
95
+
> from the file type list, change **XSD File (\*.xsd)** to **All Files (\*.\*)**.
96
+
97
+
The map surface now shows data types from the target schema.
98
+
99
+
> [!NOTE]
100
+
>
101
+
> You can also add your source and target schema files locally to your
102
+
> logic app project in the **Artifacts** > **Schemas** folder, so that
103
+
> they appear in Visual Studio Code. In this case, you can specify your
104
+
> source and target schema in the Data Mapper tool on the **Configure**
105
+
> pane by selecting **Select existing**, rather than **Add new**.
106
+
107
+
The following table describes the possible data types that might appear in a schema:
108
+
109
+
| Symbol | Type | Notes |
110
+
|--------|------|-------|
111
+
|| Array | Contains items or repeating item nodes |
112
+
|| Binary ||
113
+
|| Bool | True or false only |
114
+
|| Complex | An XML object with children properties, similar to the Object JSON type |
115
+
|| DateTime ||
116
+
|| Decimal ||
117
+
|| Integer | Whole numbers only |
118
+
|| Null | Not a data type, but appears when an error or an invalid type exists |
119
+
|| Number | A JSON integer or decimal |
120
+
|| Object | A JSON object with children properties, similar to the Complex XML type |
121
+
|| String ||
122
+
123
+
<aname="navigate-map"></a>
94
124
95
125
## Navigate the map
96
126
@@ -103,36 +133,52 @@ To move around the map, you have the following options:
103
133
|--------|---------------------|
104
134
|**Zoom in**| On the map surface, double select. |
105
135
|**Zoom out**| On the map surface, press SHIFT + double select. |
106
-
|**Zoom to fit**||
107
-
|**Show (Hide) mini-map**||
136
+
|**Zoom to fit**|None |
137
+
|**Show (Hide) mini-map**|None |
108
138
109
139
- To move up one level on the map, on the breadcrumb path, select a previous level.
110
140
111
-
<aname="create-basic-mapping"></a>
141
+
<aname="select-elements"></a>
112
142
113
-
## Create a basic mapping relationship
143
+
## Select the elements that you want to map
144
+
145
+
1. On the map surface, from the target schema list, select the target element that you want to map. If that element is a child of a parent element, find and expand the parent first.
114
146
115
-
For a direct and simple mapping between visible child elements, follow these steps:
147
+
The source schema area on the map now shows the option to select a source element.
116
148
117
-
1.On the map surface, in the target schema area, expand the element that you want to map.
149
+
1.From the source schema area, select **Select element**.
118
150
119
-
1.In the source schema area, select **Select element**. From the element list, select one or more source elements to show them on the map. When you're done, close the source schema window.
151
+
1.From the **Source schema** window that appears, select one or more source elements to display on the map.
120
152
121
-
To add more source elements later, on the map, in the upper left corner, select **Show source schema** (node tree).
153
+
- To include the immediate children of a parent, open the parent's shortcut menu, and select **Add children**.
154
+
155
+
- To include all the children of a parent, including any subsequent parents, open the top-level parent's shortcut menu, and select **Add children (recursive)**.
156
+
157
+
1. When you're done, close the source schema window. You can always add more source elements later. On the map, in the upper left corner, select **Show source schema** (node tree).
158
+
159
+
<aname="create-basic-mapping"></a>
160
+
161
+
## Create a basic mapping relationship
162
+
163
+
For a direct and simple mapping between elements with the same type, follow these steps:
164
+
165
+
1. To review what happens in code while you create the mapping, in the map's upper right corner, select **Show code**.
122
166
123
167
1. Move your pointer over the source element so that both a circle and a plus sign (**+**) appear.
124
168
125
-
1. Drag a line to the target element and connect the circle that appears.
169
+
1. Drag a line to the target element so that the line connects to the circle that appears.
126
170
127
171
You now have a basic mapping between both elements.
128
172
129
173
<aname="create-complex-mapping"></a>
130
174
131
175
## Create a complex mapping relationship
132
176
133
-
For a more complex transformation, you can create a mapping that uses a function.
177
+
|| Any ||
178
+
179
+
For a more complex transformation, you can create a mapping that uses a function to perform a task or make a decision.
134
180
135
-
1.[Follow the steps to create a basic mapping relationship](#create-basic-mapping).
181
+
1.[Create a basic mapping relationship](#create-basic-mapping).
136
182
137
183
1. Select the line for the mapping that you created.
138
184
@@ -154,6 +200,16 @@ For a more complex transformation, you can create a mapping that uses a function
154
200
155
201
1. On the function's **Properties** tab, select the data fields to use as the input and scope for the transformation.
156
202
203
+
<aname="iterate-through-array"></a>
204
+
205
+
## Create a loop mapping between arrays
206
+
207
+
If your source and target schemas include arrays, you can create a loop mapping between the items in those arrays.
208
+
209
+
1. Add the arrays and their Expand the items
210
+
211
+
1.[Follow the steps to create a basic mapping relationship](#create-basic-mapping) between a pair of matching elements in the source and target schema.
0 commit comments