I am trying to get a json result from rest URL. Then extract the data items and process them into another format. The following image is what I did. The json result is like this. What I want is the data from "data", like "id", "Replenishment Status" , "Supplier Name(id)"... But I always got the error "Error on line 1 of document : Attribute name "Status" associated with an element type "Replenishment" must be followed by the ' = ' character. Nested exception: Attribute name "Status" associated with an element type "Replenishment" must be followed by the ' = ' character. disconnected" I guess this is caused by there is a space in between "Replenishment Status" . I saw there was a ticket has the same issue this one: https://jira.talendforge.org/browse/TDI-31974 I am using TOS 6.1, also I tried the latest version 6.2.1. They all have the same problem. When I remove tExtractJsonField component, the result printed out correctly. May I know if there is a solution for this? If I cannot use tExtractJsonField, is there any other way I can map those json data into other format? Thanks!
Hi I tested and got the same result.Try to replace all "Replenishment Status" with "Replenishment_Status" on a tJavaRow before tExtractJsonFields, , for example: ...tJavaRow--main--tExtractJsonFields... on tJavaRow: output_row.result=input_row.result.replaceAll("Replenishment Status","Replenishment_Status")
---------------------------------------------------------- Talend | Data Agility for Modern Business
Hi Shong, i have tried trest--->(main) textractjsonfields----->tmap---->tmysqloutput here am unable to complie the job.am getting error notification as ERROR_CODE cannot be resolved or it is not field Body cannot be resolved or it is not field what settings i need to use in tRest.am passing an url.no ned to pass any headers. here i have tried tfilejsoninput with url, but i got java.io.IOException: Illegal character: <> this exception. am using encode as UTF-8 Appreciate for quick response Regards, Rekha