Export CSV using CreateFile?
I have created a workflow that allows the user to create a polygon using a geometry picker in a form, this then intersects another layer (HFL) with QueryLayer and identifies all the features within that polygon.
This part all works and ive tested with alerts for outputs.
I would like the result of the QueryLayer to be output as a CSV. I'm not 100% sure what I need to put in the Content section.
I have tried:
=$query1.features
This doesn't work.
Any advice?
-
Hi Courtney,
The output of a Query Layer activity is a whole object, meaning a CSV won't be able to handle it.
In order to successfully generate a CSV, the Content property in the Create File activity will need to be formatted like a CSV (i.e. a string with commas delineating columns and line breaks separating rows). To do this, I would recommend using a Create Value activity and populating it with the desired feature attributes from the Query Layer activity. If you are dealing with a large amount of data, you may also want to make use of loops and Add Item activities.
You can check the outputs of your activities in the Console tab of the browser dev tools, which can be opened by pressing F12 when running the workflow. Adding Log activities can help you check whether the expression you are entering is formatted correctly and is of the correct type for your purposes.
I hope that helps!
Alisa
1
Please sign in to leave a comment.
Comments
1 comment