How to read an element inside another element in json with UpdateRecord
Hi, Nifi Community. I'm trying to read an element inside another element in json with UpdateRecord in the following json: "data": [ ["Date", "Campaign name", "Cost"], ["2020-08-25", "01.M.VL.0.GSP", 75.14576], ["2020-08-25", "11.b.da.0.search", 344.47], ["2020-08-25", "12.m.dl.0.search", 98.04], ["2020-08-25", "13.m.dl.0.search", 276.98], ["2020-08-25", "14.m.dl.0.search", 23.7], ["2020-08-25", "15.m.dl.0.search", 3.87], ["2020-08-25", "16.b.da.0.search", 4.2], ["2020-08-25", "19.m.dl.0.display", 71.452542], ["2020-08-25", "55.m.vl.1.youtube", 322.875653], ["2020-08-25", "57.m.dl.0.youtube", 124.061768], ["2020-08-25", "58.m.vl.1.youtube", 0.387847], ["2020-08-25", "59.m.vl.1.youtube", 72.637692], ["2020-08-25", "62.b.vl.1.youtube", 1.397887] ] For example, I need to get the value '59.m.vl.1.youtube' or the date value '2020-08-25'. Here's my processor settings: [image: image.png] Can someone suggest something? Thank you. -- Grato, Wesley C. Dias de Oliveira. Linux User nº 576838.
Re: How to read an element inside another element in json with UpdateRecord
Try $.data[6][1] to get the "15.m..".. entry. On Tue, Aug 25, 2020 at 3:17 PM Wesley C. Dias de Oliveira < wcdolive...@gmail.com> wrote: > Hi, Nifi Community. > > I'm trying to read an element inside another element in json with > UpdateRecord in the following json: > > "data": [ > ["Date", "Campaign name", "Cost"], > ["2020-08-25", "01.M.VL.0.GSP", 75.14576], > ["2020-08-25", "11.b.da.0.search", 344.47], > ["2020-08-25", "12.m.dl.0.search", 98.04], > ["2020-08-25", "13.m.dl.0.search", 276.98], > ["2020-08-25", "14.m.dl.0.search", 23.7], > ["2020-08-25", "15.m.dl.0.search", 3.87], > ["2020-08-25", "16.b.da.0.search", 4.2], > ["2020-08-25", "19.m.dl.0.display", 71.452542], > ["2020-08-25", "55.m.vl.1.youtube", 322.875653], > ["2020-08-25", "57.m.dl.0.youtube", 124.061768], > ["2020-08-25", "58.m.vl.1.youtube", 0.387847], > ["2020-08-25", "59.m.vl.1.youtube", 72.637692], > ["2020-08-25", "62.b.vl.1.youtube", 1.397887] > ] > > For example, I need to get the value '59.m.vl.1.youtube' or the date value > '2020-08-25'. > > Here's my processor settings: > [image: image.png] > > Can someone suggest something? > > Thank you. > -- > Grato, > Wesley C. Dias de Oliveira. > > Linux User nº 576838. > -- Eric Ladner
Re: How to read an element inside another element in json with UpdateRecord
That's JsonPath, not a record path, but it would be almost the same: /data/[1][0] to get the date. Adjust the array indexes accordingly to get other values. On Tue, Aug 25, 2020 at 5:52 PM Eric Ladner wrote: > Try $.data[6][1] to get the "15.m..".. entry. > > On Tue, Aug 25, 2020 at 3:17 PM Wesley C. Dias de Oliveira < > wcdolive...@gmail.com> wrote: > >> Hi, Nifi Community. >> >> I'm trying to read an element inside another element in json with >> UpdateRecord in the following json: >> >> "data": [ >> ["Date", "Campaign name", "Cost"], >> ["2020-08-25", "01.M.VL.0.GSP", 75.14576], >> ["2020-08-25", "11.b.da.0.search", 344.47], >> ["2020-08-25", "12.m.dl.0.search", 98.04], >> ["2020-08-25", "13.m.dl.0.search", 276.98], >> ["2020-08-25", "14.m.dl.0.search", 23.7], >> ["2020-08-25", "15.m.dl.0.search", 3.87], >> ["2020-08-25", "16.b.da.0.search", 4.2], >> ["2020-08-25", "19.m.dl.0.display", 71.452542], >> ["2020-08-25", "55.m.vl.1.youtube", 322.875653], >> ["2020-08-25", "57.m.dl.0.youtube", 124.061768], >> ["2020-08-25", "58.m.vl.1.youtube", 0.387847], >> ["2020-08-25", "59.m.vl.1.youtube", 72.637692], >> ["2020-08-25", "62.b.vl.1.youtube", 1.397887] >> ] >> >> For example, I need to get the value '59.m.vl.1.youtube' or the date >> value '2020-08-25'. >> >> Here's my processor settings: >> [image: image.png] >> >> Can someone suggest something? >> >> Thank you. >> -- >> Grato, >> Wesley C. Dias de Oliveira. >> >> Linux User nº 576838. >> > > > -- > Eric Ladner >