<?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: olt transform in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/olt-transform/m-p/374763#M242129</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106283"&gt;@nict&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Not sure how you want to add your headings (firstDetails, secondDetails...etc.) specially secondDetails is not found anywhere in your jolt spec. If you are just looking to associate different records (test1, test2, test3...etc.) to different header based on the value of "Name" where you have to list each Name value explicitly,&amp;nbsp; then something like this will work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "dataPackage": {
        "datatest": {
          "field": {
            "*": {
              "Name": {
                "test1": {
                  "@(2,content)": "firstDetails.test1"
                },
                "test2": {
                  "@(2,content)": "firstDetails.test2"
                },
                "test3": {
                  "@(2,content)": "secondDetails.test3"
                }
              }
            }
          }
        }
      }
    }
	}
]&lt;/LI-CODE&gt;&lt;P&gt;You can add more values\header as needed. However, if you are looking to create header dynamically based on the Name values then you have to provide more info on how you would associate records with header.&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2023 20:42:35 GMT</pubDate>
    <dc:creator>SAMSAL</dc:creator>
    <dc:date>2023-07-31T20:42:35Z</dc:date>
    <item>
      <title>olt transform</title>
      <link>https://community.cloudera.com/t5/Support-Questions/olt-transform/m-p/374762#M242128</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am a newbie to Nifi Jolt transform.&amp;nbsp; I've been looking through the document, but still cannot figure out how to do mutiple headings for one array.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;input json&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;BR /&gt;"dataPackage": {&lt;BR /&gt;"datatest": {&lt;BR /&gt;"field": [&lt;BR /&gt;{&lt;BR /&gt;"Name": "test1",&lt;BR /&gt;"content": 45&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"Name": "test2",&lt;BR /&gt;"content": 20&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"Name": "test3",&lt;BR /&gt;"content": 23&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jolt Spec&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;BR /&gt;{&lt;BR /&gt;"operation": "shift",&lt;BR /&gt;"spec": {&lt;BR /&gt;"dataPackage": {&lt;BR /&gt;"datatest": {&lt;BR /&gt;"field": {&lt;BR /&gt;"*": {&lt;BR /&gt;"Name": {&lt;BR /&gt;"test1": {&lt;BR /&gt;"#test1": "field[&amp;amp;3].Name",&lt;BR /&gt;"@(2,content)": "field[&amp;amp;3].content"&lt;BR /&gt;},&lt;BR /&gt;"test2": {&lt;BR /&gt;"#test2": "field[&amp;amp;3].Name",&lt;BR /&gt;"@(2,content)": "field[&amp;amp;3].content"&lt;BR /&gt;},&lt;BR /&gt;"test3": {&lt;BR /&gt;"#test3": "field[&amp;amp;3].Name",&lt;BR /&gt;"@(2,content)": "field[&amp;amp;3].content"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}, {&lt;BR /&gt;"operation": "shift",&lt;BR /&gt;"spec": {&lt;BR /&gt;"field": {&lt;BR /&gt;"*": {&lt;BR /&gt;"@(0,content)": "firstDetails.@(1,Name)"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;current output&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;BR /&gt;"firstDetails" : {&lt;BR /&gt;"test1" : 45,&lt;BR /&gt;"test2" : 20,&lt;BR /&gt;"test3" : 23&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Expected output&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;BR /&gt;"firstDetails" : {&lt;BR /&gt;"test1" : 45,&lt;BR /&gt;"test2" : 20&lt;BR /&gt;},&lt;BR /&gt;"secondDetails" : {&lt;BR /&gt;"test3" : 23&lt;BR /&gt;}&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;can you please help&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 20:13:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/olt-transform/m-p/374762#M242128</guid>
      <dc:creator>nict</dc:creator>
      <dc:date>2023-07-31T20:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: olt transform</title>
      <link>https://community.cloudera.com/t5/Support-Questions/olt-transform/m-p/374763#M242129</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106283"&gt;@nict&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Not sure how you want to add your headings (firstDetails, secondDetails...etc.) specially secondDetails is not found anywhere in your jolt spec. If you are just looking to associate different records (test1, test2, test3...etc.) to different header based on the value of "Name" where you have to list each Name value explicitly,&amp;nbsp; then something like this will work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "dataPackage": {
        "datatest": {
          "field": {
            "*": {
              "Name": {
                "test1": {
                  "@(2,content)": "firstDetails.test1"
                },
                "test2": {
                  "@(2,content)": "firstDetails.test2"
                },
                "test3": {
                  "@(2,content)": "secondDetails.test3"
                }
              }
            }
          }
        }
      }
    }
	}
]&lt;/LI-CODE&gt;&lt;P&gt;You can add more values\header as needed. However, if you are looking to create header dynamically based on the Name values then you have to provide more info on how you would associate records with header.&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 20:42:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/olt-transform/m-p/374763#M242129</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-07-31T20:42:35Z</dc:date>
    </item>
  </channel>
</rss>

