You are viewing limited content. For full access, please sign in.

Question

Question

SDK script to create blank .csv file with header

asked on January 30, 2018

Can anyone give me a SDK script that can create a .csv file on the workflow server once I run a workflow?

Run this workflow to retrieve field values from many entries and store them into one csv file. This workflow works good. But I wanna create a .csv file before "Insert Data" to this file.

Can anyone tell me how to write script to create it? The header should have four columns which are "PO Number,Job Number,SupplierCode,ApprovalDate". Thanks
 

0 0

Answer

SELECTED ANSWER
replied on January 30, 2018 Show version history

Jerry,

I would actually skip the Insert Data activity and just write the script to create the file, write the header data, and then step through the multi-value tokens to write the data.  Here is an earlier post with code samples that does just that.

https://answers.laserfiche.com/questions/77293/How-to-export-multivalue-token-into-csv-file

 

The primary difference is that you want to retrieve the field values in your For Each Entry loop and then update a set of multi-value tokens with the field values.  After you have stepped through each entry then I would write the CSV.  Something like this workflow

0 0
replied on January 31, 2018

Your code is awesome!!! It works for me.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.