Automatically export xlsx from results list?
Wondering if there is a way to do this inside of my workflow? Currently, I have my user select "Export to XLSX" from the results context list menu. I would like to eliminate that extra step for users can just have the xlsx automatically export or provide a link within workflow for user to click to download xlsx (similar to report). I am using Workflow 5.10 and Viewer HTML 5.2.11
-
Hi, not sure if you already solved it but you can try calling ExportResultsTo command from your workflow with following arguments:
- format: "xlsx"
- fsc: geocortex.framework.applications[0].featureSetManager.currentResultSet.value
You can test it from browser's console with this:
geocortex.framework.applications[0].command('ExportResultsTo').execute({format:'xlsx',fsc:geocortex.framework.applications[0].featureSetManager.currentResultSet.value})
0 -
Hey Bogdan,
Thank you for responding to my question. I am still working on this and have not had success.
I tried using the "Run Command" to call "ExportResultsTo" command in my workflow with the arguments you suggested and got this error:
Error in buttonBar2 element's clicked event in a Display Form activity: [WF: expression evaluation error] The given expression could not be evaluated. "{
format: "xlsx",
fsc: geocortex.framework.applications[0].featureSetManager.currentResultSet.value
}" Cannot read property 'framework' of undefined
And when I test is in my browser's console, I got this error:
Uncaught TypeError: Cannot read property 'value' of undefined
Attached is my inputs to the "Run Command" command, is there a mistake the way I set up the command?
Again thank you for your help!
Valerie
0 -
We've recently moved to the latest version of Geocortex and I've noticed there is a change in the API. CurrentResultSet (geocortex.framework.applications[0].featureSetManager.currentResultSet) returns null, not an object, if there are no selected features and that's why you've got an exception when run it inside browser's console.
For use in your workflow, you can try to get a reference to the result set using Get Selected Features activity and pass it's result to fsc parameter. Sorry I've forgot to mention my example is for use in browser's console not Workflow:
app = geocortex.framework.applications[0];
app.command('ExportResultsTo').execute({format:'xlsx',fsc:app.featureSetManager.currentResultSet.value});
I'm sorry but my account for workflow 5 has expired, I'm still waiting for renewal so I can't help you with more examples.
0 -
Valerie,
Did you ever figure this out?
brian
0
Please sign in to leave a comment.
Comments
4 comments