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/logic-apps-data-operations-code-samples.md
+39-2Lines changed: 39 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: logic-apps
5
5
ms.suite: integration
6
6
ms.reviewer: estfan, azla
7
7
ms.topic: conceptual
8
-
ms.date: 08/20/2022
8
+
ms.date: 12/13/2023
9
9
---
10
10
11
11
# Data operation code samples for Azure Logic Apps
@@ -324,7 +324,7 @@ To try the [**Parse JSON** action example](../logic-apps/logic-apps-perform-data
324
324
325
325
## Select
326
326
327
-
To try the [**Select** action example](../logic-apps/logic-apps-perform-data-operations.md#select-action), here are the action definitions you can use:
327
+
To try the [**Select** action example](../logic-apps/logic-apps-perform-data-operations.md#select-action), the following action definitions create a JSON object array from an integer array:
328
328
329
329
```json
330
330
"actions": {
@@ -363,6 +363,43 @@ To try the [**Select** action example](../logic-apps/logic-apps-perform-data-ope
363
363
},
364
364
```
365
365
366
+
The following example shows action definitions that create a string array from a JSON object array, but for this task, next to the **Map** box, switch to text mode () in the designer, or use the code view editor instead:
367
+
368
+
```json
369
+
"actions": {
370
+
"Initialize_variable_-_object_array": {
371
+
"type": "InitializeVariable",
372
+
"inputs": {
373
+
"variables": [
374
+
{
375
+
"name": "myObjectArray",
376
+
"type": "Array",
377
+
"value": [
378
+
{"Val":"1", "Txt":"One"},
379
+
{"Val":"2", "Txt":"Two"},
380
+
{"Val":"4", "Txt":"Four"},
381
+
{"Val":"10", "Txt":"Ten"}
382
+
]
383
+
}
384
+
]
385
+
},
386
+
"runAfter": {}
387
+
},
388
+
"Select": {
389
+
"type": "Select",
390
+
"inputs": {
391
+
"from": "@body('myObjectArray')?['value']",
392
+
"select": "@{item()?['Txt']}"
393
+
},
394
+
"runAfter": {
395
+
"Initialize_variable_-_object_array": [
396
+
"Succeeded"
397
+
]
398
+
}
399
+
}
400
+
},
401
+
```
402
+
366
403
## Next steps
367
404
368
405
*[Perform data operations](../logic-apps/logic-apps-perform-data-operations.md)
Copy file name to clipboardExpand all lines: articles/logic-apps/logic-apps-perform-data-operations.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: logic-apps
5
5
ms.suite: integration
6
6
ms.reviewer: estfan, azla
7
7
ms.topic: how-to
8
-
ms.date: 05/23/2023
8
+
ms.date: 12/13/2023
9
9
# As a developer using Azure Logic Apps, I want to perform various data operations on various data types for my workflow in Azure Logic Apps.
10
10
---
11
11
@@ -1203,12 +1203,16 @@ If you used the Office 365 Outlook action, you get a result similar to the follo
1203
1203
1204
1204
## Select action
1205
1205
1206
-
To create an array that contains JSON objects built from the values in an existing array, use the **Select** action. For example, you can create a JSON object for each value in an integer array by specifying the properties that each JSON object must have and mapping the values from the source array to those properties.
1207
-
1208
-
Although you can change the component JSON objects, the output array always has the same number of items as the source array. To use the output array from the **Select** action, subsequent actions must either accept arrays as input, or you might have to transform the output array into another compatible format.
1206
+
By default, the **Select** action creates an array that contains JSON objects built from the values in an existing array. For example, you can create a JSON object for each value in an integer array by specifying the properties that each JSON object must have and mapping the values from the source array to those properties. Although you can change the component JSON objects, the output array always has the same number of items as the source array. To use the output array from the **Select** action, subsequent actions must either accept arrays as input, or you might have to transform the output array into another compatible format.
1209
1207
1210
1208
To try the **Select** action, follow these steps by using the workflow designer. Or, if you prefer working in the code view editor, you can copy the example **Select** and **Initialize variable** action definitions from this guide into your own logic app's underlying workflow definition: [Data operation code examples - Select](../logic-apps/logic-apps-data-operations-code-samples.md#select-action-example). For more information about this action in your underlying workflow definition, see [Select action](logic-apps-workflow-actions-triggers.md#select-action).
1211
1209
1210
+
> [!TIP]
1211
+
>
1212
+
> For an example that creates create an array with strings or integers built from the values in a JSON object array,
1213
+
> see the **Select** and **Initliaze variable** action definitions in
0 commit comments