Member since
07-29-2020
574
Posts
323
Kudos Received
176
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 2507 | 12-20-2024 05:49 AM | |
| 2888 | 12-19-2024 08:33 PM | |
| 2553 | 12-19-2024 06:48 AM | |
| 1716 | 12-17-2024 12:56 PM | |
| 2386 | 12-16-2024 04:38 AM |
05-02-2023
09:48 AM
2 Kudos
Hi, This one was a little trickier from the first post, but it seems that there is nothing that you cant do with Jolt 🙂 . Please try the following spec: [
{
// combine all resourceRelationshipCharacteristic under one group
// and assign each element under the group unique key depending on
// its index location starting from first array under resourceRelationship (&3) and
// and ending with nested array resourceRelationshipCharacteristic ($1) so
// each element will have unique name 00,01,10,11...
"operation": "shift",
"spec": {
"resource": {
"resourceRelationship": {
"*": {
"resourceRelationshipCharacteristic": {
"*": {
"@(6,header.action)": "&3&1.action",
"@(6,header.timeStamp)": "&3&1.timeStamp",
"@(2,relationDrniId)": "&3&1.relationDrniId",
"*": "&3&1.&"
}
}
}
}
}
}
},
{
// bucket each element (00,01,10,11) value into new Array records
"operation": "shift",
"spec": {
"*": "records.[#1]"
}
}
] Hope that helps. I wonder if there is better\cleaner way @araujo @cotopaul @steven-matison
... View more
05-01-2023
06:30 AM
Hi , Can you provide the expected json output? The json you provided seems complex and nested. I'm not sure what exactly you are expecting.
... View more
04-26-2023
10:58 AM
1 Kudo
Hi, Try the following spec: [
{
// This is to remove the @ character from @type property because I could not
// figure out how to make it work in the second shift using escape character '\'
"operation": "shift",
"spec": {
"header": "&",
"resource": {
"\\@type": "resource.type",
"*": "resource.&"
}
}
},
{
"operation": "shift",
"spec": {
"resource": {
"resourceCharacteristic": {
"*": {
"name": "records[&1].propname",
"*": "records[&1].&",
"@(2,name)": "records[&1].name",
"@(2,type)": "records[&1].type",
"@(2,subtype)": "records[&1].subtype",
"@(2,drniId)": "records[&1].drniId",
"@(3,header.activityId)": "records[&1].activityId",
"@(3,header.timeStamp)": "records[&1].timeStamp"
}
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"records": {
"*": {
"value": "=join(',', @(1,value))"
}
}
}
}
] If that helps please accept solution. Thanks
... View more
04-20-2023
11:03 AM
1 Kudo
Hi , Can you replace the following: {
"operation": "shift",
"spec": {
"properties": {
"*": {
// simple match. Put the value '4' in the output under the "Rating" field
"title": "Questions[&1].question",
"type": {
"number": {
"#select": "Questions[&3].type"
},
"string": {
"#textarea": "Questions[&3].type"
},
"array": {
"#multiselect": "Questions[&3].type"
}
},
"$": "Questions[&1].id"
}
} with the following spec: {
"operation": "shift",
"spec": {
"properties": {
"*": {
// simple match. Put the value '4' in the output under the "Rating" field
"title": "Questions_&1.question",
"type": {
"number": {
"#select": "Questions_&3.type"
},
"string": {
"#textarea": "Questions_&3.type"
},
"array": {
"#multiselect": "Questions_&3.type"
}
},
"$": "Questions_&1.id"
}
}
}
}
,
{
"operation": "shift",
"spec": {
"*": "&",
"Questions_*": "Questions[]"
}
} Reference : https://stackoverflow.com/questions/70394715/remove-null-from-array-using-jolt If that helps please accept solution. Thanks
... View more
04-19-2023
09:42 AM
Hi, Can you explain on what basis are you trying to extract "options": 9876 & 9875 only and not 9874? Is it based on the index as in the first option and the second option only and ignore anything after?
... View more
04-17-2023
01:18 PM
Hi , Did you try the following: ${latitude:toDecimal():math("toRadians")} Or ${latitude:math("toRadians")}
... View more
04-17-2023
09:21 AM
Try the below spec. Again not sure if this is the most efficient way. You might need to rethink your strategy if you are dealing with a lot of data: [
{
//package all test fields into an outer object
"operation": "shift",
"spec": {
"test*": "outer.&",
"Details": "Details"
}
},
{
// Insert each outer object into Details element 0,1,..
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details.&1.&",
"@(3,outer)": "Details.&1.outer"
}
}
}
},
{
//Bucket each outer object (test1, test2...) into each details element
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details.&1.&",
"outer": {
"*": {
"@": "Details.&3.&"
}
}
}
}
}
},
{
//package details into seperate element under an Array
"operation": "shift",
"spec": {
"Details": {
"*": "[#1].Details.&"
}
}
}
]
... View more
04-16-2023
11:49 AM
Im not sure what you specified is makes sense because you would have two keys with the same name "Details" but different values. I assume what you want is this: {
"Details": {
"0": {
"test1": "test output",
"test2": "test output",
"id": "first",
"name": "the first one"
},
"1": {
"test1": "test output",
"test2": "test output",
"id": "second",
"name": "the second one"
}
}
} In this case the spec would be like this: [
{
//package all test fields into an outer object
"operation": "shift",
"spec": {
"test*": "outer.&",
"Details": "Details"
}
},
{
// Insert each outer object into Details element 0,1,..
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details.&1.&",
"@(3,outer)": "Details.&1.outer"
}
}
}
},
{
//Bucket each outer object (test1, test2...) into each details element
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details.&1.&",
"outer": {
"*": {
"@": "Details.&3.&"
}
}
}
}
}
}
] Not sure if this is the best way, if someone knows a better way please provide your suggestion. If that answers your question please accept solution. Thanks
... View more
04-16-2023
08:19 AM
Hi, You have not specified the desired output, but would the following give you what you are looking for: [
{
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details[#2].&"
}
},
"*": "outer[].&"
}
},
{
"operation": "shift",
"spec": {
"Details": "Details",
"outer": {
"*": {
"*": "Details[&1].&"
}
}
}
}
] if that helps please accept solution. Thanks
... View more
04-15-2023
08:23 AM
Hi, If you are looking to set the id value for the first element in the columns array you can use the following spec: [
{
"operation": "shift",
"spec": {
"columns": {
"0": {
"value": "[].@(1,name)"
}
}
}
}
] If that helps please accept solution.
... View more