title: JMESPath - Joining items in a nested array
body: <p>I have a JSON </p>
  
  <pre><code>{
  "key": "processId-29231",
  "fields": {
      "attachment": [
          {
              "id": "79572",
              "filename": "File1.png"
          },
          {
              "id": "74620",
              "filename": "File2.docx"
          },
          {
              "id": "79072",
              "filename": "File3.xlsx"
          }
      ]
    }
  }
  </code></pre>
  
  <p>I need to restructure it to this</p>
  
  <pre><code>{
  "processId": "processId-29231",
  "attachments": [
  
                 "https://example.com/files/79572/File1.png",
                 "https://example.com/files/79572/File2.docx",
                 "https://example.com/files/79572/File1.xlsx",
                  ]
      }
  </code></pre>
  
  <p>I could make this work with a specific array index </p>
  
  <pre><code>{processID:key,attachments:join('',['https://example.com/files/',fields.attachment[1].id,'/',fields.attachment[1].filename])}
  </code></pre>
  
  <p>which yields this result </p>
  
  <pre><code>{
   "processID": "processId-29231",
   "attachments": "https://example.com/files/74620/File2.docx"
  }
  </code></pre>
  
  <p>I tried this without array index in two ways</p>
  
  <p>this </p>
  
  <pre><code> {processID:key,attachments:join('',['https://example.com/',fields.attachment[].id,'/',fields.attachment[].filename])}
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>{processID:key,attachments:join('', ['https://example.com/',fields.attachment[*].id,'/',fields.attachment[*].filename])}
  </code></pre>
  
  <p>but that did not help.</p>
  
  <p>Any tips on how this can be solved?</p>