Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Store form data in CSV format at the end of a workflow

Avatar

Former Community Member
Hi,



At the end of my workflow (when the form goes past the last approver) I would like to store the form data in a CSV format into a folder. How can this be achieved?



Thanks and regards,

Shivajiv.
6 Replies

Avatar

Level 9
Hi

Please be a little more specific. Are you wanting each form to add one line to a long CSV file, or each field in the form to appear on a different line, or what?



Thanks,

Howard

http://www.avoka.com

Avatar

Former Community Member
Hi Howard,



Thanks for the response.

I would ideally like each field in the form to appear on a different line. Is this possible?



Thanks and regards,

Shivajiv.

Avatar

Former Community Member
Hello -



This is defintiveley possible, using a custom QPac or the Script QPac. You would have to retrieve the Form Variable which has your data in it using an XPath expression, and then either load the resulting data in an XML Dom and parse through the fields. You would have to also append the code to a file.



It is possible as well that the Avoka team has already written some sort of QPac that will do something along these lines. The choice is up to you whether to build it yourself or purchase pre-built QPacs. I'll let Howard respond with the availability of such a QPac.



Good Luck!



Will

Avatar

Former Community Member
Hi Will,



Thanks for your help.

I got this working. I followed the same approach that you have mentioned.



Thanks and regards,

Shivajiv.

Avatar

Level 9
Hi Shivajiv

Sorry, missed this thread when it was first posted.

Glad that you've gotten it working - which approach did you use?

We actually have two qpacs that might be of assistance the next time you encounter this issue:

1. CSVExport. This creates a CSV file based on a SQL query.

2. SetTextValue. This allows you to create a large string, with embedded xpath expressions. The string can be whatever you want. So you could use something like:

{$/process_data/myform/.../field1$}, {$/process_data/myform/.../field2$}, etc...



Howard

http://www.avoka.com

Avatar

Former Community Member
Hi Howard,



I used the Script QPAC to create and store my CSV file.



Thanks and regards,

Shivajiv.