pack_all()
Learn how to use the pack_all() function to create a dynamic object from all the columns of the tabular expression.
Creates a dynamic property bag object from all the columns of the tabular expression.
Syntax
pack_all([ ignore_null_empty ])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| ignore_null_empty | bool | Indicates whether to ignore null/empty columns and exclude them from the resulting property bag. The default value is false. |
Example
The following query uses pack_all() to create packed columns.
datatable(Source:string,Target:string,CharsCount:long)
[
'555-1234','555-1212',46,
'555-1234','555-1213',50,
'555-1313','',42,
'','555-3456',74
]
| extend Packed=pack_all(), PackedIgnoreNullEmpty=pack_all(true)
Output
| Source | Target | CharsCount | Packed | PackedIgnoreNullEmpty |
|---|---|---|---|---|
| 555-1234 | 555-1212 | 46 | { “Source”:“555-1234”, “Target”:“555-1212”, “CharsCount”: 46 } | { “Source”:“555-1234”, “Target”:“555-1212”, “CharsCount”: 46 } |
| 555-1234 | 555-1213 | 50 | { “Source”:“555-1234”, “Target”:“555-1213”, “CharsCount”: 50 } | { “Source”:“555-1234”, “Target”:“555-1213”, “CharsCount”: 50 } |
| 555-1313 | 42 | { “Source”:“555-1313”, “Target”:"", “CharsCount”: 42 } | { “Source”:“555-1313”, “CharsCount”: 42 } | |
| 555-3456 | 74 | { “Source”:"", “Target”:“555-3456”, “CharsCount”: 74 } | { “Target”:“555-3456”, “CharsCount”: 74 } |
Related content
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.