Support Questions

Find answers, ask questions, and share your expertise

NiFi PutEmail - How to create a tabular content using a JSON array of objects?

Explorer

Hi there,

NiFi PutEmail - How to create a tabular content using a JSON array of objects?

For eg. Flow File Attribute 'documents' (jsonObject) is present which looks like below:

[ { "itemId": "ITEM-001", qty: 150 }, { "itemId": "ITEM-002", qty: 250 }]

 

The email messageText should loop through the json array and produce the tabular content. (<td>${item.itemId}</td><td>${item.qty}</td>) so that it generate the following table: 

<table>

  <tr><td>ITEM-001</td><td>150</td></tr>

  <tr><td>ITEM-002</td><td>250</td></tr>

</table>

1 REPLY 1

Explorer
 
 
I have instead created a custom processor to convert the velocity template & generate a nice tabular content.
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.