Member since
07-17-2023
7
Posts
0
Kudos Received
0
Solutions
07-20-2023
08:54 AM
@SAMSAL my bad !!! I start to be old i need better glasses 🙂 You are right it works fantastically !!! THANKS!!!!!
... View more
07-19-2023
10:54 PM
@SAMSAL , here the information requested Thanks again for your help and time. Cheers
... View more
07-19-2023
09:27 AM
@SAMSAL , thanks alot for your time 🙂 You find at the end of my message the json I got both after the jolt transfromation and after the queryrecord. As you can see I called a different list and the result has more fields than the original example, but I also change the queryrecord (select) acconrdling. This is the jolt transformation properties This is the query record properties (that I call just after the jolt) This is the json result (beutify) after the jolt trasformation (I just send the first 3 records, in reality they are 100): [ { "class" : "STORE", "classdesc" : "Stores", "classorg" : "*", "commissiondate" : "01-JAN-2010", "datecreated" : "23-FEB-2021 13:57", "equipmentdesc" : "Superstore", "imageurl" : "", "lastsaved" : "07-MAR-2021 13:39", "latitude" : "", "location" : "PURLEY", "locationdesc" : "Purley", "locationorg" : "RETAIL", "locationtype" : "L", "longitude" : "", "obj_code" : "03293", "orderline" : "", "orderorg" : "", "organization" : "RETAIL", "partcode" : "", "partorg" : "", "poorder" : "", "propertydefinition" : "", "status" : "I", "statusdesc" : "Installed", "store" : "", "systemstatus" : "I", "systemstatusdesc" : "Installed", "systemtype" : "P", "type" : "SHOP", "typedesc" : "Shop / Store" }, { "class" : "AREA", "classdesc" : "Area", "classorg" : "*", "commissiondate" : "01-JAN-2010", "datecreated" : "23-FEB-2021 16:18", "equipmentdesc" : "Extra - Yard", "imageurl" : "", "lastsaved" : "05-MAR-2021 15:09", "latitude" : "51.4876", "location" : "CARDIFF", "locationdesc" : "Cardiff", "locationorg" : "RETAIL", "locationtype" : "L", "longitude" : "", "obj_code" : "02230.YRD", "orderline" : "", "orderorg" : "", "organization" : "RETAIL", "partcode" : "", "partorg" : "", "poorder" : "", "propertydefinition" : "", "status" : "I", "statusdesc" : "Installed", "store" : "", "systemstatus" : "I", "systemstatusdesc" : "Installed", "systemtype" : "P", "type" : "AREA", "typedesc" : "Area" }, { "class" : "AREA", "classdesc" : "Area", "classorg" : "*", "commissiondate" : "01-JAN-2010", "datecreated" : "23-FEB-2021 16:19", "equipmentdesc" : "Extra - S/Floor Bakery", "imageurl" : "", "lastsaved" : "05-MAR-2021 15:09", "latitude" : "", "location" : "CARDIFF", "locationdesc" : "Cardiff", "locationorg" : "RETAIL", "locationtype" : "L", "longitude" : "", "obj_code" : "02230.BAK", "orderline" : "", "orderorg" : "", "organization" : "RETAIL", "partcode" : "", "partorg" : "", "poorder" : "", "propertydefinition" : "", "status" : "I", "statusdesc" : "Installed", "store" : "", "systemstatus" : "I", "systemstatusdesc" : "Installed", "systemtype" : "P", "type" : "AREA", "typedesc" : "Area" } ] And this is what I got after the QueryRecord (taken the first 3 records, but all are the same) [ { "obj_code" : null, "equipmentdesc" : null }, { "obj_code" : null, "equipmentdesc" : null }, { "obj_code" : null, "equipmentdesc" : null }] So it seems that the queryrecord return the correct columns but they are empty. Thanks again!!!
... View more
07-19-2023
04:37 AM
Thanks @SAMSAL , the first processor works as a dream, (FANTASTIC THANKS). For the second I might have missed something as I got correctly only name and namedesc, but they are all set to null...
... View more
07-18-2023
08:14 AM
Thanks Samsal, would be ok to have a json such as "LIST" : [ { "name": "JSMITH", "namedesc": "John Smith" }, { "name": "RSTONE", "namedesc": "Robert Stone" }] or similarly in a CSV "JSMITH", "John Smith" "RSTONE", "Robert Stone" Thanks PS: of course the number of records returned by the API can be more than 2 and also the numer of fields can be more than the example of 3 (depending on the list I ask to the API to return. I normally can see what it is returned so I can know in advance which are all the possible "FIELDNAME" and the decide which are the fieldname I want to have in the JSON or in CSV, but it is of also fine to have all of them (in the example I gave they would be "name", "namedesc", "hireddate")
... View more
07-17-2023
10:06 AM
PS: of course any other Processors instead of "ExtractText" that solve the problem is also welcome 🙂
... View more
07-17-2023
10:02 AM
I'm using the NIFI ExtractText Processor and I'm trying to come up with the regular expression to extract values from a JSON String that is in the flowfile-content coming from a response of an API (of course I cannot change how the API responds). JSON Data returned from the REST API is: { "Result" : { "SessionID" : null, "ResultData" : { "DATAENTITYNAME" : "List", "CURRENTCURSORPOSITION" : 2, "DATARECORD" : [ { "DATAFIELD" : [ { "FIELDNAME" : "name", "FIELDLABEL" : "Name", "DATATYPE" : "VARCHAR", "FIELDVALUE" : "JSMITH", "ISKEYFIELD" : true }, { "FIELDNAME" : "namedesc", "FIELDLABEL" : "Name Desc.", "DATATYPE" : "MIXVARCHAR", "FIELDVALUE" : "John Smith", "ISKEYFIELD" : false }, { "FIELDNAME" : "hireddate", "FIELDLABEL" : "Hired Date", "DATATYPE" : "DATE", "FIELDVALUE" : "01-JAN-2010", "ISKEYFIELD" : false }] }, { "DATAFIELD" : [ { "FIELDNAME" : "name", "FIELDLABEL" : "Name", "DATATYPE" : "VARCHAR", "FIELDVALUE" : "RSTONE", "ISKEYFIELD" : true }, { "FIELDNAME" : "namedesc", "FIELDLABEL" : "Name Desc.", "DATATYPE" : "MIXVARCHAR", "FIELDVALUE" : "Robert Stone", "ISKEYFIELD" : false }, { "FIELDNAME" : "hireddate", "FIELDLABEL" : "Hired Date", "DATATYPE" : "DATE", "FIELDVALUE" : "01-JAN-2011", "ISKEYFIELD" : false }] }, }, "InfoAlert" : null, "WarningAlert" : null }, "ConfirmationAlert" : null, "ErrorAlert" : [ ] } How do I get all "name" and "namedesc"? (in the example: JSMITH -> John Smith and RSTONE -> Robert Stone) Thanks!!!!!
... View more
Labels:
- Labels:
-
Apache NiFi