JSON snap not working as expected
JSON splitter last week was working correctly. Pipeline was not edited, JSON format did not change, and yet Pipeline is crashing indicating error that JSON splitter is expecting list not an object. Before 17th of Feb it was working perfectly fine. was something changed in snap architecture? “Failure: Json Splitter expects a list, Reason: Found an object of type class java.util.LinkedHashMap, Resolution: The path $.data needs to refer to a list in the incoming document”Solved10KViews0likes16CommentsJSON data size fix
My source data has more than 1M record which is in a csv format. All those records had error , hence were routed to error view. Now , All those records needs to be logged in a S3 folder. Also i send an email to the team which contains the file name and location. The data is loaded in a json format in S3 which is still fine but it takes a longer time to open the json file (which is obvious) but can we do this in a more efficient manner ?Sometime the log file does not load at all ☹️ Data must go to S3 folder but how we are storing it is open for discussion , like the records can be put in csv, txt or json format. I had an idea of Splitting those records and saving it as 2-3 json file but now sure , if it is even appealing. Any ideas ?Solved6.6KViews0likes5CommentsHow to flatten hierarchial JSON structure?
Hi Forum, I have hierarchical JSON structure coming as input and need to flatten(and transformation) the document as output. Below is the simple example showing input and output structure. I tried doing this with Mapper, Strcuture and JSON Splitter snaps but could not achieve it. Anyone know how to solve this? Input document structure: [ { "entity": { "results": [ { "id": 453721, "custom_fields": [ { "id": 11111, "value": "AAAA" }, { "id": 22222, "value": "BBBB" }, { "id": 33333, "value": "CCCC" } ] } ] } } ] Desired Output Document structure: [ { "entity": { "results": [ { "id": 453721, "11111" : "AAAA", "22222" : "BBBB" } ] } } ]5.8KViews0likes3CommentsIssues in reading Nested Json file
Hi, I tried executing the example for Json Splitter provided in their home page, but the results i’m getting does not match with what they provided in their page. Could someone please correct me if i am wrong somewhere. SamplePipeline.slp (6.6 KB) ExpectedResult.xlsx (8.4 KB) Thanks, Muthu4.9KViews0likes2CommentsJSON splitter does not split objects properly
I am having an isssue splitting the JSON for an object. I am initially reading an xml and then using XML parser to convert that to JSON document output. I will try to explain the issue with example. Please note that the input is an xml file. It can have one or more than more DetailRecords as per the different xmls below. Splitter logic is Json Path field set to - $Root.DetailRecord[*] XML 1 < HEADER> DEFAULT AUD Tanya F David M XML 2 < HEADER> DEFAULT AUD Tanya F • When there are multiple records (Refer XML 1) : Splitter split both the records (DetailRecord) as expected and provide a flat structure with input schema Name and Gender. • When there is 1 record (Refer XML 2) : Splitter behaves differently. It split the values rather than records and provide values Tanya, F under column splitvalue. So, the logic to transform the data breaks. My aim is that, whether it is one sub record or more, it should detect that its an object and split it however here if its more then one then it converts it to object and if its one then it leaves that as string and thus I cannot dynamically change whether to use splitter or not and the pipeline fails it I use splitter and it has one record only.4.6KViews0likes1CommentMapper vs. JSON Splitter
Did you know that you can use the Mapper snap to the same effect as JSON Splitter? There are some other reasons why you may want to use JSON Splitter. First of all let’s look at how mapper can achieve similar functionality of JSON Splitter To achieve the same split, in the mapper, just drag the array into the left hand expression and map it to $ in the right hand side target path. Basically this will split the array elements into the outgoing documents. Using JSON Splitter however, you get additional benefits of including scalar parents as well as including different output paths as part of the split. Attached is an example (simple one of course). json split vs mapper_2017_08_08.slp (7.1 KB)4.5KViews2likes0CommentsAlternate for JSON Splitter - Split single document into multiple rows
Hi, I am currently using Json Splitter in a pipeline to split records and send it to Oracle merge. As there are huge records, json splitter processing time is very high. Tried moving the json splitter and Oracle merge snap into a different pipeline and enabled re-use in pipeline execute. Still no improvement in the performance. Kindly let me know if there is any alternate for Json Splitter. Tried the below approach in mapper to split single document (consisting multiple objects) into multiple rows. But it returns array of array. Input file : SampleInput.txt (267 Bytes) Mapper expression: {}.extend($response.map((elem, index) => elem)).values() Target: $ Expected output: Best Regards, Pooja4.1KViews0likes1CommentJSON Splitter to REST Call capture all response bodies
I have a pipeline that takes an Array of JSON as input. We then feed it to a JSON Splitter that then goes into a REST POST to some endpoint. I see that all of the REST calls go through in the Ultra task, however only the first response body from the first REST call is returned by Snap. Does anyone know how to capture all the response bodies into an array, and only after all REST calls are processed, then SnapLogic sends back its array of responses? Or is this not possible…3.4KViews0likes3CommentsAfter using a JSON splitter and a filter, how do you put the object/array back together?
Hi, we needed to filter on a JSON input. We managed to get that working by using a JSON splitter on the element and then piping that to a filter snap. Our issue is now the input that looked like this: "allLocations": { "location": [ { "addressInternalid": 2631363, "isDelete": false, "internalSupplierid": 3423589, "acctGrpid": "RT", "address1": "5309 GREENWAY", "address2": "5301 REDWAY", "address3": "5504 BLUEWAY", "poBox": "0912KHJWD", "country": "USA", "state": "US-TX", "city": "FREE", "zip": "78211", "phone": "2229808888", "phoneExtn": "091", "fax": "747", "faxExtn": "737" }, { "addressInternalid": 2631367, "isDelete": false, "internalSupplierid": 3423589, "acctGrpid": "RT", "address1": "11305 4 PTS DR", "address2": "BLDG 2,#100", "country": "USA", "state": "US-TX", "city": "AUSTIN", "zip": "78726", "phone": "5126648805", "phoneExtn": "123", "fax": "123", "faxExtn": "134" }, { "addressInternalid": 2631368, "isDelete": false, "internalSupplierid": 3423589, "acctGrpid": "RT", "address1": "REMIT 11305 4 PTS DR", "address2": "BLDG 3", "country": "USA", "state": "US-TX", "city": "AUSTIN", "zip": "78725", "phone": "5126600000", "phoneExtn": "678", "fax": "678", "faxExtn": "678" } ] }, Looks like this: [ { "addressInternalid": 2631363, "isDelete": false, "internalSupplierid": 3423589, "acctGrpid": "RT", "address1": "5309 GREENWAY", "address2": "5301 REDWAY", "address3": "5504 BLUEWAY", "poBox": "0912KHJWD", "country": "USA", "state": "US-TX", "city": "FREE", "zip": "78211", "phone": "2229808888", "phoneExtn": "091", "fax": "747", "faxExtn": "737", "fullCompanyName": "SUPPLIER MARCH 3 dba TEXT", "requestId": 5272423, "id": "3423589", "facilityCode": "0001", "systemCode": "1", "supplierType": "Operational", "status": "ACTIVE" }, { "addressInternalid": 2631367, "isDelete": false, "internalSupplierid": 3423589, "acctGrpid": "RT", "address1": "11305 4 PTS DR", "address2": "BLDG 2,#100", "country": "USA", "state": "US-TX", "city": "AUSTIN", "zip": "78726", "phone": "5126648805", "phoneExtn": "123", "fax": "123", "faxExtn": "134", "fullCompanyName": "SUPPLIER MARCH 3 dba TEXT", "requestId": 5272423, "id": "3423589", "facilityCode": "0001", "systemCode": "1", "supplierType": "Operational", "status": "ACTIVE" }, { "addressInternalid": 2631368, "isDelete": false, "internalSupplierid": 3423589, "acctGrpid": "RT", "address1": "REMIT 11305 4 PTS DR", "address2": "BLDG 3", "country": "USA", "state": "US-TX", "city": "AUSTIN", "zip": "78725", "phone": "5126600000", "phoneExtn": "678", "fax": "678", "faxExtn": "678", "fullCompanyName": "SUPPLIER MARCH 3 dba TEXT", "requestId": 5272423, "id": "3423589", "facilityCode": "0001", "systemCode": "1", "supplierType": "Operational", "status": "ACTIVE" } ] How do I get it back into an object so I can map it correctly? As you can see in the below image, all of the location fields are coming in as strings with no hierarchy, not the array they were originally. Any tips would be appreciated!3.4KViews0likes2CommentsConverting a JSON list to an Array
How to convert Json list to Array It’s very simple to covert JSON list to Array in SnapLogic. Simply drag and drop the Snap “Json Splitter” and connect to any document format snap whose downstream is a JSON list like in the attached example, select the Json path and the output that you’ll recieve at the downstream of the JSON splitter will be an array. JSON_Splitter_2017_02_18.slp (2.9 KB)3.4KViews0likes0Comments