<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Extracting List(Array) element using JOLT in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387007#M246216</link>
    <description>&lt;P&gt;This customfield_ will not change because it is static. I'm handling this aspect in NiFi right now, however I get into trouble when I acquire more fields as lists and have to change the NIFI Flow.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Apr 2024 06:33:12 GMT</pubDate>
    <dc:creator>saquibsk</dc:creator>
    <dc:date>2024-04-23T06:33:12Z</dc:date>
    <item>
      <title>Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/386868#M246167</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you assist me in retrieving the values stored in the "&lt;FONT color="#0000FF"&gt;customfield_10161&lt;/FONT&gt;"&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;field from JSON input? My expectation is to consistently receive the values and name it "&lt;FONT color="#0000FF"&gt;DEFECT_ROOT_CAUSE&lt;/FONT&gt;" , whether they are stored as a list or as a single value."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;How to write JOLT which will handle the both the case. let say If I will get list then extract last element of it, if not list then record as it is.?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;Extracting List: (works fine when input is list)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_0-1713731749160.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40366i9D48E98387432BB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_0-1713731749160.png" alt="saquibsk_0-1713731749160.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;when input is not list:&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;then&amp;nbsp;DEFECT_ROOT_CAUSE column is missing My expectation to get the records in&amp;nbsp;DEFECT_ROOT_CAUSE columns whether its list or not.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_1-1713731973678.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40367iF93C3F846F6F6D2E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_1-1713731973678.png" alt="saquibsk_1-1713731973678.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 20:45:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/386868#M246167</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-21T20:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/386872#M246169</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/104295"&gt;@saquibsk&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;The below spec should put you on the right path if it doesnt completely solve your issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  // Assign isArray flag field when there is an array (index starts at 0)
  {
    "operation": "shift",
    "spec": {
      "id": "INTEGRATION_ID",
      "*": {
        "*_*": {
          "@": "&amp;amp;(1,1)",
          "0": {
            "#true": "isArray"
          }
        }
      }
    }
   }
  ,
  //If the input is not an array assign default isArray=false
  {
    "operation": "default",
    "spec": {
      "isArray": "false"
    }
    }
    ,
  //Depending on with isArray true of false:
  //Transpose values into DEFECT_ROOT_CAUSE_List array
  
  {
    "operation": "shift",
    "spec": {
      "customfield": null,
      "*": "&amp;amp;",
      "isArray": {
        "true": {
          "@(2,customfield)": {
            "*": {
              "value": {
                "@": "DEFECT_ROOT_CAUSE_List[]"
              }
            }
          }
        },
        "false": {
          "@(2,customfield)": "DEFECT_ROOT_CAUSE_List[]"
        }
      }
    }
    }
  	,
  // Finally, get the last element of the array
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "DEFECT_ROOT_CAUSE": "=lastElement(@(1,DEFECT_ROOT_CAUSE_List))"
    }
    }

]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that helps please accept solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 22:36:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/386872#M246169</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-04-21T22:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/386881#M246173</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for the reply.&lt;/P&gt;&lt;P&gt;There are still no columns showing in the non-list scenario.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_0-1713762938776.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40369i809480000DFFDB5E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_0-1713762938776.png" alt="saquibsk_0-1713762938776.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 05:17:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/386881#M246173</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-22T05:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/386939#M246191</link>
      <description>&lt;P&gt;In my jolt spec its expecting customfield_10616 , so in my spec if you notice in the first shift Im using the expression *_* basically to make more dynamic but at least you have to have an underscore but if you think otherwise you can change it to whatever works for your data, for example you can change it to "customfield" , "customfield_*" , "*" , etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 12:47:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/386939#M246191</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-04-22T12:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387007#M246216</link>
      <description>&lt;P&gt;This customfield_ will not change because it is static. I'm handling this aspect in NiFi right now, however I get into trouble when I acquire more fields as lists and have to change the NIFI Flow.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 06:33:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387007#M246216</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-23T06:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387027#M246222</link>
      <description>&lt;P&gt;This is how I am currently handling the records. All I'm doing is flagging the rows and sending them to the appropriate process. However, suppose in the future that a new field or an existing one begins to capture List data; in that case, I would need to modify the flow and add more conditions. I just needed a single field, therefore let's say that if it captures the list, it will show up as the last record or as a single record.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_0-1713869512819.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40390iBE36F62CB8C57633/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_0-1713869512819.png" alt="saquibsk_0-1713869512819.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 10:58:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387027#M246222</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-23T10:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387038#M246229</link>
      <description>&lt;P&gt;I think the issue here is stating what the problem is vs the actual problem. since you starting posting the issue, I noticed the json input has changed 3 times. Remember as someone said "Asking the right question is half way the path to finding the right solution".&lt;/P&gt;&lt;P&gt;Allow&amp;nbsp; me give you some pointers:&lt;/P&gt;&lt;P&gt;1- Please specify the different json input for all possible scenarios and the expected output\s.&lt;/P&gt;&lt;P&gt;2- If you have compound problem then divide and conqueror. Break the big problem into smaller one where each is isolated to its own input, output and&amp;nbsp; assertions..&lt;/P&gt;&lt;P&gt;3- Simplify if you can, for example if you have complex json input and you are only facing issue with particular field or nested object then you dont have to post the whole json , instead you isolate where the issue is and provide that part only or create new one that mimic the same structure.&lt;/P&gt;&lt;P&gt;4- If you have code or some formatted data please use the code block "&amp;lt;/&amp;gt;" from the menu item for better visibility and readability. Dont post code\data as screenshot.&lt;/P&gt;&lt;P&gt;5- Use screenshots for when suitable , like showing nifi flow, processor configuration ..etc.&lt;/P&gt;&lt;P&gt;6- Refer to the community guidelines for more info: &lt;A href="https://community.cloudera.com/t5/custom/page/page-id/Community_Guidelines" target="_blank" rel="noopener"&gt;https://community.cloudera.com/t5/custom/page/page-id/Community_Guidelines&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 13:40:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387038#M246229</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-04-23T13:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387050#M246235</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;My requirement is very simple.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I anticipate receiving the single records in the output. That's DEFECT_ROOT_CAUSE, regardless of whether my input is a list or sinlge records.&lt;/P&gt;&lt;P&gt;(The primary source is JIRA; a bug ticket has been generated there, indicating that the issue may be in the front end or back end. However, occasionally a reporter will tag the back end before the front end, leading to the creation of a list. )&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saquibsk_0-1713890872587.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40391i08361B4C91C8901F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saquibsk_0-1713890872587.png" alt="saquibsk_0-1713890872587.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; my input is almost 200 line however I am only putting the required column only. I have posted two image one is for list records and one is single records with same column (only records is getting changes that's it.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 17:01:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387050#M246235</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-23T17:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387070#M246237</link>
      <description>&lt;P&gt;Based on my json spec above:&lt;/P&gt;&lt;P&gt;1- customfield_* with multiple records list&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAMSAL_0-1713912768426.png" style="width: 684px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40392i5D0628CC43479880/image-dimensions/684x417?v=v2" width="684" height="417" role="button" title="SAMSAL_0-1713912768426.png" alt="SAMSAL_0-1713912768426.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2- customfield_* with single records list:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAMSAL_1-1713912843333.png" style="width: 707px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40393i623E6FD7562B051D/image-dimensions/707x451?v=v2" width="707" height="451" role="button" title="SAMSAL_1-1713912843333.png" alt="SAMSAL_1-1713912843333.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3- customfield_* with no list:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAMSAL_2-1713912974290.png" style="width: 648px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/40394i3B88F8C8D3FD883B/image-dimensions/648x416?v=v2" width="648" height="416" role="button" title="SAMSAL_2-1713912974290.png" alt="SAMSAL_2-1713912974290.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp; asterisk in customfield_* means anything as long there is a customfield , underscore (_) and whatever comes after.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 22:59:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387070#M246237</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-04-23T22:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387624#M246360</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Am I missing something on the JOLT?&lt;/P&gt;&lt;P&gt;Not getting output as expected. (DEFECT_ROOT_CUASE) columns is missing from output.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;===========================================
--Input
===========================================
{
  "id": "33414",
  "fields": {
    "customfield_10161": [
      {
        "value": "Backend"
      },
      {
        "value": "Frontend"
      }
    ]
  }
}

===========================================
--JOLT Spec
===========================================

[
  // Entries (where "flat" "data" when there is an array) (now starts at 8)
  {
    "operation": "shift",
    "spec": {
      "id": "INTEGRATION_ID",
      "*": {
        "*_*": {
          "@": "&amp;amp;(1,1)",
          "0": {
            "#true": "isArray"
          }
        }
      }
    }
},
 //If the input is not an array, assign default isArray=false 
  {
    "operation": "default",
    "spec": {
      "isArray": "false"
    }
  },
 //Depending on with isArray true for false
 //Transpose values into DEFECT_ROOT_CAUSE_List_Array 
  {
    "operation": "shift",
    "spec": {
      "customfield": null,
      "*": "&amp;amp;",
      "isArray": {
        "true": {
          "@(2,customfield)": {
            "*": {
              "value": {
                "@": "DEFECT_ROOT_CAUSE_LIST[]"
              }
            }
          }
        },
        "false": {
          "@(2,customfield)": "DEFECT_ROOT_CAUSE_LIST[]"
        }
      }
    }
},
 // Finally, get the last element of the array
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "DEFECT_ROOT_CAUSE": "=lastElement(@(1,DIRECT_ROOT_CAUSE_LIST))"
    }
 }
]

===========================================
--Output
===========================================

{
  "INTEGRATION_ID" : "33414",
  "DEFECT_ROOT_CAUSE_LIST" : [ "Backend", "Frontend" ]
}
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 12:12:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387624#M246360</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-05-06T12:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387628#M246364</link>
      <description>&lt;P&gt;The reason its not working because there is mismatch in the list name 3rd spec where its using "&lt;STRONG&gt;&lt;FONT color="#008000"&gt;DEFECT&lt;/FONT&gt;&lt;/STRONG&gt;_ROOT_CAUSE_LIST" and the 4th spec where its using "&lt;FONT color="#800000"&gt;&lt;STRONG&gt;DIRECT&lt;/STRONG&gt;&lt;/FONT&gt;_ROOT_CAUSE_LIST" . If you fix this it should work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you find this is helpful please accept solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 14:05:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387628#M246364</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-05-06T14:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387639#M246368</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you very much, &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;. I really appreciate your time and effort.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My input format has changed. &lt;SPAN&gt;I will adjust the JOLT accordingly if it does not work or encounter any issues, I will ask one final question. Otherwise, I will mark your last reply as the solution.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 20:42:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387639#M246368</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-05-06T20:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387640#M246369</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Just to give a heads up, my input will be something like the example below. I have around 60 columns, and out of those, only 4 columns are in the list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Example: from below example i would like to handle the "DEFECT_ROOT_CAUSE" and "SPRINT_LIST"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Output would be same as your solution:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DEFECT_ROOT_CAUSE:"Frontend"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SPRINT_LIST:"24-w2-3"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;==================================
-- input 1
==================================

[ {
  "INTEGRATION_ID" : "1111",
  "ISSUE_KEY" : "PP2-7426",
  "SUMMARY" : "Confirmation Web",
  "SPRINT_LIST" :"24-w2-1",
  "DEFECT_TYPE" : "poor user interface design, confusing navigation",
  "TEAM" : "Web Engineering",
  "PLATFORM" : "Customer Web",
  "DEFECT_ROOT_CAUSE" : [ "Backend", "Frontend" ]
  }
]  


==================================
-- input 2
================================== 


[ {
  "INTEGRATION_ID" : "2222",
  "ISSUE_KEY" : "PP2-7427",
  "SUMMARY" : "Confirmation Web",
  "SPRINT_LIST" : [ "24-w2-1", "24-w2-2", "24-w2-3" ],
  "DEFECT_TYPE" : "poor user interface design, confusing navigation",
  "TEAM" : "Web Engineering",
  "PLATFORM" : "Customer Web",
  "DEFECT_ROOT_CAUSE" : "Backend"
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 20:54:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387640#M246369</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-05-06T20:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387641#M246370</link>
      <description>&lt;P&gt;Based on the provided new input and the expected output as I was able to understand where you always want to consider the last element of both DEFECT_ROOT_CAUSE &amp;amp; SPRINT_LIST which both may or may not be an array of values, I would take a different approach to the jolt spec which is much simpler as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  // First spec is convert everything into list regardless
  {
    "operation": "cardinality",
    "spec": {
      "*": {
        "SPRINT_LIST": "MANY",
        "DEFECT_ROOT_CAUSE": "MANY"
      }
    }
  }
  ,
  // From the generated list above return last element
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "*": {
        "SPRINT_LIST": "=lastElement",
        "DEFECT_ROOT_CAUSE": "=lastElement"
      }
    }
  }

]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 21:21:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387641#M246370</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-05-06T21:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387650#M246374</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you, &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;. This logic is much simpler. My JOLT logic was a bit complex. This is going to save me a lot of time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there are any tutorial where we can learn the JOLT ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 06:43:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387650#M246374</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-05-07T06:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387672#M246385</link>
      <description>&lt;P&gt;There is not really a comprehensive Jolt tutorial that I could find out there. Two important references I frequently use to learn is :&lt;/P&gt;&lt;P&gt;1- The Jolt code in github where you can see how things work under the hood and what are the available functions:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/bazaarvoice/jolt" target="_blank"&gt;https://github.com/bazaarvoice/jolt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2- A site that talks about the fundamental of jolt:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.digibee.com/documentation/components/tools/transformer-jolt/transformer-getting-to-know-jolt#cardinality" target="_blank"&gt;https://docs.digibee.com/documentation/components/tools/transformer-jolt/transformer-getting-to-know-jolt#cardinality&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The rest is practice, practice and more practice. Its the only way you can get some depth in the understanding of jolt and its capabilities.&amp;nbsp; You can do that by trying to help and learn from others posts in this community forum or other forums like the below where you can find tons of jolt problems\solutions:&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/tagged/jolt" target="_blank"&gt;https://stackoverflow.com/questions/tagged/jolt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope that helps and thanks for accepting the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 05:29:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/387672#M246385</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-05-08T05:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting List(Array) element using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/388789#M246779</link>
      <description>&lt;P&gt;hi SAMSAL, i send you message. Can you check it please ?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 07:31:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Extracting-List-Array-element-using-JOLT/m-p/388789#M246779</guid>
      <dc:creator>omeraran</dc:creator>
      <dc:date>2024-06-05T07:31:35Z</dc:date>
    </item>
  </channel>
</rss>

