Configuring JSON Property Concatenator - Ironstream_Hub - 1.3.1

Ironstream Hub Administration

Product type
Software
Portfolio
Integrate
Product family
Ironstream
Product
Ironstream > Ironstream Hub
Version
1.3.1
Language
English
ContentType
Administration
Product name
Ironstream Hub
Title
Ironstream Hub Administration
Topic type
Administration
First publish date
2022

This process allows you to join two or more values from JSON key/value pairs and add the resulting value, with a name of your choice, into JSON records.

If this process is deployed then all JSON key names will be sorted into strict ascending Unicode character order. In general, this means numbers sort lowest followed by upper case letters which sort before lower case letters. New JSON key/value pairs are inserted into the re-ordered list of key/value pairs in the appropriate place.

When ProcessType is set to JsonPropertyConcatenator, a parent field named JsonPropertyConcatenatorConfiguration must be populated with sets of fields as shown below. You may have any number of Name and Value pairs as you wish. If you do not enter sufficient properties to allow the process to function, the process will be invalid and the pipeline will not start.

Fields Description Valid Values
PropertiesToConcatenate A list of the JSON key names that if present in a JSON record will have their values joined by the Delimiter string. Any valid JSON key name
NameOfPropertyContainingResult The JSON key name that will hold the concatenated value from the keys listed in PropertiesToConcatenate. Any valid JSON key name
Delimiter Typically a single character, or can be a string. This is used to separate the values of the JSON key names listed in PropertiesToConcatenate. Any character or set of characters except a double quote
Example JSON Property Concatenator File
{
  "Name": "D_PropertyConcatenator",
  "Id": "3632e729-6efd-460b-9385-567824482fb6",
  "JsonPropertyConcatenatorConfiguration": {
    "PropertiesToConcatenate": ["job_name","job_id"],
    "NameOfPropertyContainingResult": "JobNameJobId",
    "Delimiter": "|"
  },
  "ProcessType": "JsonPropertyConcatenator"
}

Here we are looking for a JSON key names of job_name and job_id and when both are found, creating a new JSON key of JobNameJobId. The value of the item will be a concatenation of the job_name and job_id fields, separated by the specified delimiter character. All values going into a concatenation are treated as strings and the output value is enclosed in double quotes to denote it is a string.

For the example parameters above, given a JSON record of:
{ "job_name":"fred", "job_type":"batch", "user":"PRODPAY", "job_id":11738 }
A new JSON key/value pair would be created and inserted and the resulting JSON record would be re-ordered as:
{ "JobNameJobId":"fred|11738", "job_id":11738, "job_name":"fred",
  "job_type":"batch", "user":"PRODPAY" }

If any of the JSON key names listed in PropertiesToConcatenate are missing in a JSON record, the record will pass unaltered through this process.

If any of the values of the JSON key names listed in PropertiesToConcatenate are missing, a JSON record will have it's field re-ordered as described above and the key named in NameOfPropertyContainingResult will be added in the correct place to maintain the key name sort order. Delimiters will still be used to separate the component parts of the output key, treating the missing values as "null strings", including if necessary having a delimiter as the first or last character of the value for the new key.

Example:

Using the sample configuration above and this sample record (note that the job_id key/value pair is not present):

{ "job_name":"fred", "job_type":"batch", "user":"PRODPAY" }
A new JSON key/value pair would be created and inserted and the resulting JSON record would be re-ordered as (note that the newly created key/value pair's value has a trailing delimiter):
{ "JobNameJobId":"fred|",  "job_name":"fred",  "job_type":"batch", 
"user":"PRODPAY" }