i have a query on a Database which give me Infomation like this:
i want to create a HTML Table with Information of the query above and send it to Email of Developer as Error Notification. Can you help me with the HTML code?. Thankyou alot!
This would be one way to achieve what you have been trying for -
Job Layout -
Now, for your use case you would get the data from database
- I had manipulated the data to be retrieved from tFixedFlowInput
. Once you have the data retrieved you would need to perform few html
formatting through tJavaFlex
like below -
Once done, stored the entire content in a context variable and refer the same in your tSendMail - > "Message".
Also, make the following change to your tSendMail component to use the HTML
formats -
Output -
Note: there are many formatting features which could be used through HTML tags
, please use them as needed as per your use case - scenario.
Edit: Yes you would be able to check if there are any rows returned from your Db-Input. Ex: global variable ((Integer)globalMap.get("tMSSqlInput_2_NB_LINE"))
would let us know how many lines are returned by the query. Based on this result use RunIf
trigger
((Integer)globalMap.get("tMSSqlInput_2_NB_LINE")) > 0
and connect to your job flow so that mail would be send when there are records retrieved from database
.