Skip to main content
Kinetic Community

Storing Customer Answer Table as CSV

Once you have collected answers in a table format and saved them into a JSON as specified in this solution, you will then want to use them. This solution describes how to transform the table to CSV and use that comma delimited result.

Usage

What you do with the table stored in the JSON string will entirely depend on what you want to do with it. 

You may want to push the data into a incident, change, or plain text email. To do this, you can use this handler to convert the stored JSON into CSV and push the comma delimited output into the desired location. 

You may want to store this data in a format that is easier to read than JSON for reporting purposes. There are a multiple possible solutions for this. One of the simplest is to use this handler to convert the stored JSON into CSV and push the comma delimited output into a hidden question on the service item using the create answer handler

Example

The pictured example is included in the updated Table of Answers service item attached to this solution record. Note that you must load the related/refrenced handlers into your systems before the examples will function. Example trees are inactive. Activate them one at time, activating Place Table as CSV in item for reporting purposes to test this example.

Place Table as CSV in item for reporting purposes

PlaceTableinCSV.png

The example depicted here and included in the sample item places the CSV created into an answer. The CSV could also be place in Change or Incident notes as well, where-ever the data is desired. Note that in this particular case, the Utility JSON to CSV handler is expecting a slightly different format than what is saved in the answer JSON. To turn one of the saved tables into JSON, you'll need to add some JSON to what you already have stored. 

{"Table":<your answer>}