Extract Property
apama.analyticskit.blocks.core.ExtractProperty
Extracts the specified property from the input value and converts it to the specified type.
The value in the Value input named by the Property Path parameter should be a string, number or boolean.
You can specify a period (.) as part of the Property Path parameter to extract nested values from a dictionary.
For example: If the input is { "location" : { "city" : "Cambridge" } } (in JSON form), then you can extract that value by specifying location.city as the Property Path parameter.
You can also specify square brackets as part of the Property Path parameter to extract a specific element from a sequence.
If the value is an object, then the properties of that object are output as properties on the Extracted Value output port.
For example: If the input is { "users" : [ { "age" : 40.375 } ] } (in JSON form), then you can extract that value by specifying users[0].age as the Property Path parameter.
The block does not support extracting entries from a dictionary whose key contains special characters like the period (.) or square brackets. Also it does not support extracting entries from a sequence without using square brackets, for example, users.0.id must be written as users[0].id.
In converting a string to a float, this block treats an empty string as a value of 0.0, rather than as not parseable.
Parameters
Name | Description | Type | Notes |
Property Path | The name or path of the property that is to be extracted from the input value. If not set, all of the properties are output. | string | Optional |
Property Type | The type to which the property value is to be converted. If set to Properties, a pulse is output with properties from the extracted value. | Option - one of: String Boolean Float Properties | Default: String |
Clear On Missing | If selected, the default value of the specified type is output if the Property Path parameter was not specified or if the value cannot be converted into the specified type. | boolean | Default: false |
Input Port Details
Name | Description | Type |
Value | The input value from which the property is to be extracted. | any |
Output Port Details
Name | Description | Type |
Extracted Value | The value that has been extracted from the input value. | any |