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
+55-24Lines changed: 55 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,10 +181,16 @@ For a straightforward transformation between elements with the same type in the
181
181
182
182

183
183
184
-
The code view window reflects the direct mapping that you created:
184
+
The code view window reflects the mapping relationship that you created:
185
185
186
186

187
187
188
+
> [!NOTE]
189
+
>
190
+
> If you create a mapping between elements where their data types don't match, a warning appears on the target element, for example:
191
+
>
192
+
> 
193
+
188
194
<aname="create-complex-mapping"></a>
189
195
190
196
## Create a complex mapping between elements
@@ -201,63 +207,88 @@ For a more complex transformation between elements in the source and target sche
201
207
| String | Code points to string, Concat, Contains, Ends with, Length, Lowercase, Name, Regular expression matches, Regular expression replace, Replace, Starts with, String to code-points, Substring, Substring after, Substring before, Trim, Trim left, Trim right, Uppercase |
202
208
| Utility | Copy, Error, Format date-time, Format number |
203
209
204
-
### Add a function without an existing mapping
210
+
### Add a function with a single input
211
+
212
+
The example in this section transforms the source element type from String type to DateTime type, which matches the target element type. The example uses the **To date** function, which takes a single input.
213
+
214
+
1. Make sure that map shows the source and target elements that you want.
215
+
216
+
1. In the map's upper left corner, select **Show functions**.
217
+
218
+

219
+
220
+
1. From the functions list that opens, find and select the function that you want to use, which adds the function to the map. If the function doesn't appear visible on the map, try zooming out on the map surface.
221
+
222
+
This example selects the **To date** function.
223
+
224
+

225
+
226
+
> [!NOTE]
227
+
>
228
+
> If no mapping line exists or is selected when you add a function to the map, the function
229
+
> appears on the map, but disconnected from any elements or other functions, for example:
230
+
>
231
+
> 
232
+
233
+
1. Expand the function shape to display the function's details and connection points. To expand the function shape, select inside the shape.
205
234
206
235
1. Connect the function to the source and target elements.
207
236
208
237
1. Drag and draw a line between the source elements and the function's left edge. You can start either from the source elements or from the function.
209
238
239
+

240
+
210
241
1. Drag and draw a line between the function's right edge and the target element. You can start either from the target element or from the function.
211
242
212
-
1. On the function's **Properties** tab, confirm or edit the input to use.
243
+

213
244
214
-
For some data types, such as arrays, the scope for the transformation might also appear available. This scope is usually the immediate element, such as an array, but in some scenarios, the scope might exist beyond the immediate element.
245
+
1. On the function's **Properties** tab, confirm or edit the input to use.
215
246
247
+

216
248
217
-
### Add a function to an existing mapping
249
+
For some data types, such as arrays, the scope for the transformation might also appear available. This scope is usually the immediate element, such as an array, but in some scenarios, the scope might exist beyond the immediate element.
218
250
219
-
1.[Create a direct mapping between the source and target elements](#create-direct-mapping).
251
+
The code view window reflects the mapping relationship that you created:
220
252
221
-
The created mapping might show an error because the source and target data types don't match. This example transforms the source element value to a DateTime value
253
+

222
254
223
-
The function now appears connected to the selected mapping relationship.
255
+
For example, to iterate through array items, see [Create a loop between arrays](#loop-through-array). To perform a task when an element's value meets a condition, see [Create an if condition between items](#create-if-condition).
224
256
225
-
> [!NOTE]
226
-
>
227
-
> If no mapping line is selected when you select a function, the function appears on the map,
228
-
> but disconnected from any elements or other functions. To connect the function, you can drag
229
-
> and draw connections between the unmapped function and other items.
257
+
### Add a function to an existing mapping relationship
230
258
231
-
1. After the function appears on the map, select the function so that the information window appears.
259
+
When a mapping relationship already exists between source and target elements, you can add the function by following these steps:
232
260
233
-
1.Select the line for the mapping that you created.
261
+
1.On the map, select the line for the mapping that you created.
234
262
235
-
1. Move your pointer over the selected connection, and select **Insert function** when the plus sign (**+**) appears.
263
+
1. Move your pointer over the selected line, and select the plus sign (**+**) that appears.
236
264
265
+
1. From the functions list that opens, find and select the function that you want to use.
237
266
238
-
For example, to iterate through array items, see [Create a loop between arrays](#loop-through-array). To perform a task when an element's value meets a condition, see [Create an if condition between items](#create-if-condition).
267
+
The function appears on the map and is automatically connected between the source and target elements.
239
268
240
269
### Add a function with multiple inputs
241
270
242
-
The example in this section concatenates two source elements so that you can map the results to the target element.
271
+
The example in this section concatenates multiple source element types so that you can map the results to the target element type. The example uses the **Concat** function, which takes multiple inputs.
243
272
244
273
1. Make sure that map shows the source and target elements that you want.
245
274
246
275
1. In the map's upper left corner, select **Show functions**.
247
276
248
-

277
+

249
278
250
279
1. From the functions list that opens, find and select the function that you want to use, which adds the function to the map. If the function doesn't appear visible on the map, try zooming out on the map surface.
251
280
281
+
This example selects the **Concat** function:
282
+
252
283

253
284
254
285
> [!NOTE]
255
286
>
256
287
> If no mapping line exists or is selected when you add a function to the map, the function
257
-
> appears on the map, but disconnected from any elements or other functions. A red dot appears
258
-
> in the function's upper right corner to show that the function isn't correctly configured, for example:
288
+
> appears on the map, but disconnected from any elements or other functions. If the function
289
+
> requires configuration, a red dot appears in the function's upper right corner, for example:
259
290
>
260
-
> 
291
+
> 
261
292
262
293
1. Expand the function shape to display the function's details and connection points. To expand the function shape, select inside the shape.
263
294
@@ -279,7 +310,7 @@ If your source and target schemas include arrays, you can create a loop mapping
279
310
280
311
1. On the map, in the target schema area, expand the array and array items.
281
312
282
-
1. In the source schema area, add the array and items to the map.
313
+
1. In the source schema area, add the array source element and array item elements to the map.
283
314
284
315
1.[Create a direct mapping between the source and target elements](#create-direct-mapping).
285
316
@@ -289,7 +320,7 @@ If your source and target schemas include arrays, you can create a loop mapping
289
320
290
321

291
322
292
-
The code view window reflects the looping relationship that you created:
323
+
The code view window reflects the mapping relationship that you created:
293
324
294
325

0 commit comments