Relative Content

Tag Archive for jsonjolt

Jolt transform nested objects into array

Given the following Json input how do I write a Jolt spec to transform the input into the desired output below. I am unsure how to deal with nested data, and transformation of objects into arrays. I have experimented with different specs https://jolt-demo.appspot.com/#inception however I cannot seem to get the desired transformation.

Need jolt spec for the json input(nested array) and output

I have an input JSON which has nested array. I need jolt spec file which will allow only the specific fields in the output json and rest will be ignored. So I need to specify each field so that only those fields will be displayed in output and any extra unwanted field will be ignored.

JOLT Multiply two values of other fields within a flattened array

Within a JSON I have a rope length with a metric value and my task is to generate a “twin” with imperial output. Depending on the unit of measure (uom) specified in the “metric” input, an imperial value should be calculated. The value after ‘unit-‘ in the key is always variable.

Need Jolt spec for complex json to flatten and convert one field name to specific name

I have a complex input json which has few dynamic fields. I need jolt spec file which will allow only the specific fields in the output json and rest will be ignored. So I need to specify each field so that only those fields will be displayed in output and any extra unwanted field will be ignored.
The jolt spec I write is giving me the exact date(EX: “2024-04-14”)under “future” tag. But I need to convert it to a single array called “Group_Dates” and under which all the items are coming(similar like output json).

Convert Flat JSON to Nested JSON at multiple levels

Below is the JSON I have
`[
{
“item_attr1”: “abc”,
“item_attr2”: “123”,
“item_attr3”: “123”,
“item_id”: “12345”,
“bucket_attr1”: 1919,
“bucket_attr2”: “abc”,
“bucket_attr3”: 1922,
“bucket_attr4”: “abc”,
“bucket_id_1”: “abc”,
“bucket_id_2”: “def”,
“bucket_id_3”: “ghi”,
“articleattribute1”: “abc”,
“articleattribute2”: “abc”,
“articleattribute3”: “2233”,
“article_id”: “12345”
},
{
“item_attr1”: “abc”,
“item_attr2”: “123”,
“item_attr3”: “123”,
“item_id”: “543421”,
“bucket_attr1”: 1919,
“bucket_attr2”: “abc”,
“bucket_attr3”: 1922,
“bucket_attr4”: “abc”,
“bucket_id_1”: “abc”,
“bucket_id_2”: “mef”,
“articleattribute1”: “abc”,
“articleattribute2”: “abc”,
“articleattribute3”: “2233”,
“article_id”: “12345”
}
]

Jolt configuration for Middle Initial

Trying to find the middle initial Jolt configuration. Ask is, i need to consider only first character in Middle name return from Json. Also first character should be Alphabet (either caps or small case), else i need to return null.