title: I have a data and want to map all the elements to other elements
body: <pre><code>[
      {
          "clauseId": 1,
          "clauseName": "cover",
          "texts": [
              {
                  "textId": 1,
                  "text": "hello"
              }
          ]
      },
      {
          "clauseId": 3,
          "clauseName": "xyz",
          "texts": [
              {
                  "textId": 3,
                  "text": "hello Everyone"
              },
              {
                  "textId": 4,
                  "text": "Some data"
              }
          ]
      }
   {
          "clauseId": 2,
          "clauseName": "joining",
          "texts": [
              {
                  "textId": 3,
                  "text": "hello1"
              },
              {
                  "textId": 4,
                  "text": "hello2"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>If I make a list like </p>
  
  <pre><code>a=[joining,cover]
  </code></pre>
  
  <p>I want  a new list to be formed as </p>
  
  <pre><code>b=[hello1,hello2,hello]
  </code></pre>
  
  <p>Please note that index of every element matters If i reverse the index the </p>
  
  <pre><code>b =[hello,hello1,hello2]
  </code></pre>
  
  <p>If </p>
  
  <pre><code>a=[xyz,joining,cover]
  b=["hello Everyone","Some data",hello1,hello2,hello]
  </code></pre>
  
  <p>Similary If I interchange the places in a like <code>[joining,xyz,cover]</code></p>
  
  <pre><code>b=["hello1","hello2","hello Everyone","Some data",hello]
  </code></pre>
  
  <p>Please note that the incoming data can have multiple clauseName and multiple texts in it..This is just a demo</p>