Skip to content

Commit 05c392d

Browse files
committed
fixing mistake
1 parent fc8fe81 commit 05c392d

File tree

1 file changed

+0
-114
lines changed

1 file changed

+0
-114
lines changed

articles/azure-resource-manager/bicep/bicep-functions-array.md

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -404,120 +404,6 @@ The output from the preceding example is:
404404
| commonUp | array | [1, 2, 3] |
405405
| commonDown | array | [3, 2, 1] |
406406

407-
## items
408-
409-
`items(object)`
410-
411-
Converts a dictionary object to an array.
412-
413-
Namespace: [sys](bicep-functions.md#namespaces-for-functions).
414-
415-
### Parameters
416-
417-
| Parameter | Required | Type | Description |
418-
|:--- |:--- |:--- |:--- |
419-
| object |Yes |object |The dictionary object to convert to an array. |
420-
421-
### Return value
422-
423-
An array of objects for the converted dictionary. Each object in the array has a `key` property that contains the key value for the dictionary. Each object also has a `value` property that contains the properties for the object.
424-
425-
### Example
426-
427-
The following example converts a dictionary object to an array. For each object in the array, it creates a new object with modified values.
428-
429-
```bicep
430-
var entities = {
431-
item002: {
432-
enabled: false
433-
displayName: 'Example item 2'
434-
number: 200
435-
}
436-
item001: {
437-
enabled: true
438-
displayName: 'Example item 1'
439-
number: 300
440-
}
441-
}
442-
443-
var modifiedListOfEntities = [for entity in items(entities): {
444-
key: entity.key
445-
fullName: entity.value.displayName
446-
itemEnabled: entity.value.enabled
447-
}]
448-
449-
output modifiedResult array = modifiedListOfEntities
450-
```
451-
452-
The preceding example returns:
453-
454-
```json
455-
"modifiedResult": {
456-
"type": "Array",
457-
"value": [
458-
{
459-
"fullName": "Example item 1",
460-
"itemEnabled": true,
461-
"key": "item001"
462-
},
463-
{
464-
"fullName": "Example item 2",
465-
"itemEnabled": false,
466-
"key": "item002"
467-
}
468-
]
469-
}
470-
```
471-
472-
The following example shows the array that is returned from the items function.
473-
474-
```bicep
475-
var entities = {
476-
item002: {
477-
enabled: false
478-
displayName: 'Example item 2'
479-
number: 200
480-
}
481-
item001: {
482-
enabled: true
483-
displayName: 'Example item 1'
484-
number: 300
485-
}
486-
}
487-
488-
var entitiesArray = items(entities)
489-
490-
output itemsResult array = entitiesArray
491-
```
492-
493-
The example returns:
494-
495-
```json
496-
"itemsResult": {
497-
"type": "Array",
498-
"value": [
499-
{
500-
"key": "item001",
501-
"value": {
502-
"displayName": "Example item 1",
503-
"enabled": true,
504-
"number": 300
505-
}
506-
},
507-
{
508-
"key": "item002",
509-
"value": {
510-
"displayName": "Example item 2",
511-
"enabled": false,
512-
"number": 200
513-
}
514-
}
515-
]
516-
}
517-
```
518-
519-
The items() function sorts the objects in the alphabetical order. For example, **item001** appears before **item002** in the outputs of the two preceding samples.
520-
521407
## last
522408

523409
`last(arg1)`

0 commit comments

Comments
 (0)