Exporting Results to XLSX
Does anybody have any "tips or tricks" for exporting results to Excel from a Workflow?
Specifically for rounding off long Double values to just 2 decimals?
Acres: 30.400000000000002 ==> Acres: 30.40
And any tricks on converting Date values like this:
SALE_DATE: 1498089600000 into something a person can read, like this: 03/30/2021
The Workflows we use will need to export Query results, based on user Filter Criteria, like State and Year. Alternately, our Workflows need to export Selected Features values too.
-- -- --
Also any "playground resources" or demo examples that show "what type of Parameters" are expected by WF "Run Operations" and "Run Commands", would be extremely helpful too.
The Command Reference guide reads like a terse technical dictionary:
https://developers.geocortex.com/docs/web/api-commands-operations-events/#definition-ToXLSXConversionArgs
What do we need to type into these Parameters inputs to actually get these Operations to work?
A few examples would really help on this Commands page (or supplemental pages).
Thanks for your replies
James
-
OK, I've solved part of the mystery (how to specify the ToXLSXConversionArgs parameters)
This input parameter works to convert trailing Decimals to just their significant digits, for the Run Operation activity:Operation: results.convert-to-xlsx
Operation Parameter: ={features: $featureSet1.featureSet, useFormattedValues: true, numberFormat: '0.00'}No more trailing .00000000 on every number in the Excel exports, yay!
FYINow if I can just figure out to handle the Date Fields, stored as Second values in the Oracle REST Service, and somehow convert them to actual useful Dates -- you know, for humans.
While this ToXLSXConversionArgs Input Parameter runs, it does not change the Seconds value:
={features: $featureSet1.featureSet, useFormattedValues: true, numberFormat: '0.00', dateFormat: 'DD/MM/YYYY'}And trying to shoehorn in the TO_CHAR() Oracle function, throws the error:
TO_CHAR is not a function.When using this Parameter:
={features: $featureSet1.featureSet, useFormattedValues: true, numberFormat: '0.00', dateFormat: (TO_CHAR('SALE_DATE', 'YYYY-MM-DD' ))}Does anyone know what is the Javascript equivalent to this standard Oracle conversion might be ?
TO_CHAR( sysdate, 'YYYY-MM-DD' )
Thanks for your replies
James
2
Please sign in to leave a comment.
Comments
1 comment