<?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 Need Help with Jolt Transformation - Stuck for Days in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Need-Help-with-Jolt-Transformation-Stuck-for-Days/m-p/380800#M244167</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hii Everyone, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've been struggling to achieve the desired result with a Jolt transformation for the past few days and could really use some help from the community. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;input.json:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "email": "abcmail@gmail.com",
  "dates": [
    {
      "date": "2023-12-01",
      "type": "full"
    },
    {
      "date": "2023-11-03",
      "type": "full"
    },
    {
      "date": "2023-11-02",
      "type": "full"
    },
    {
      "date": "2023-10-01",
      "type": "half"
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output.json&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "emailId": "abcmail@gmail.com",
    "date": "2023-12-01",
    "type": "full"
  },
  {
    "emailId": "abcmail@gmail.com",
    "date": "2023-11-03",
    "type": "full"
  },
  {
    "emailId": "abcmail@gmail.com",
    "date": "2023-11-02",
    "type": "full"
  },
  {
    "emailId": "abcmail@gmail.com",
    "date": "2023-10-01",
    "type": "half"
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;spec file for the transformation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "email": "[].emailId",
        "dates": {
          "*": {
            "date": "[&amp;amp;1].date",
            "type": "[&amp;amp;1].type"
          }
        }
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite my efforts, I'm not achieving the expected outcome. Can anyone please review my Jolt specification and provide insights on what might be going wrong? Your assistance is highly appreciated.&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 09:54:42 GMT</pubDate>
    <dc:creator>Eva0</dc:creator>
    <dc:date>2023-12-14T09:54:42Z</dc:date>
    <item>
      <title>Need Help with Jolt Transformation - Stuck for Days</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Need-Help-with-Jolt-Transformation-Stuck-for-Days/m-p/380800#M244167</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hii Everyone, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've been struggling to achieve the desired result with a Jolt transformation for the past few days and could really use some help from the community. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;input.json:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "email": "abcmail@gmail.com",
  "dates": [
    {
      "date": "2023-12-01",
      "type": "full"
    },
    {
      "date": "2023-11-03",
      "type": "full"
    },
    {
      "date": "2023-11-02",
      "type": "full"
    },
    {
      "date": "2023-10-01",
      "type": "half"
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output.json&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "emailId": "abcmail@gmail.com",
    "date": "2023-12-01",
    "type": "full"
  },
  {
    "emailId": "abcmail@gmail.com",
    "date": "2023-11-03",
    "type": "full"
  },
  {
    "emailId": "abcmail@gmail.com",
    "date": "2023-11-02",
    "type": "full"
  },
  {
    "emailId": "abcmail@gmail.com",
    "date": "2023-10-01",
    "type": "half"
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;spec file for the transformation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "email": "[].emailId",
        "dates": {
          "*": {
            "date": "[&amp;amp;1].date",
            "type": "[&amp;amp;1].type"
          }
        }
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite my efforts, I'm not achieving the expected outcome. Can anyone please review my Jolt specification and provide insights on what might be going wrong? Your assistance is highly appreciated.&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 09:54:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Need-Help-with-Jolt-Transformation-Stuck-for-Days/m-p/380800#M244167</guid>
      <dc:creator>Eva0</dc:creator>
      <dc:date>2023-12-14T09:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Jolt Transformation - Stuck for Days</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Need-Help-with-Jolt-Transformation-Stuck-for-Days/m-p/380803#M244169</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108332"&gt;@Eva0&lt;/a&gt;, Welcome to our community! To help you get the best possible answer, I have tagged our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/31438"&gt;@TimothySpann&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103151"&gt;@cotopaul&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&amp;nbsp;who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 13:38:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Need-Help-with-Jolt-Transformation-Stuck-for-Days/m-p/380803#M244169</guid>
      <dc:creator>VidyaSargur</dc:creator>
      <dc:date>2023-12-14T13:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Jolt Transformation - Stuck for Days</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Need-Help-with-Jolt-Transformation-Stuck-for-Days/m-p/380804#M244170</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108332"&gt;@Eva0&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;You were close . I think the first astrik "*" was&amp;nbsp; not needed because the input json is not contained in an array brackets. Then to include the email in each data element it has to be added at the date &amp;amp; type level but to reference the value you need to go to 2 levels up using the&amp;nbsp;@ character as in&amp;nbsp;@(2,mail) where the email is located in relative to date &amp;amp; type.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      //level 2 where email originally is
      "dates": {
        // level 1
        "*": { 
          // start count here at level 0 
          "@(2,email)": "[&amp;amp;1].email",
          "date": "[&amp;amp;1].date",
          "type": "[&amp;amp;1].type"
        }
      }
    }
  }
  ]&lt;/LI-CODE&gt;&lt;P&gt;If you find this helpful please accept solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 13:54:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Need-Help-with-Jolt-Transformation-Stuck-for-Days/m-p/380804#M244170</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-12-14T13:54:01Z</dc:date>
    </item>
  </channel>
</rss>

