How to customizing the exporting data through the APIs (CommCare Data Export Tool)

Dear Team,

We are planning to automate the data exporting process through the
CommCare Data Export tool by specifying the time/date functions.

But i am not able to find any options supporting for the below
requirements, so kindly need your suggestions with the below points :

  1. How to specify the scheduled date/time : I am able get the data
    exported into the excel sheet with the below command :

C:>C:\python27\scripts\commcare-export --output-format xlsx --output
C:\Users\xxxxxx\Desktop\registrations.xlsx --project emergency --query
C:\Python27\demo_registrations.xlsx --since 2013-12-05

but while i tried to replace the above date with the predefined function
such as such as : today() or now (), its not accepting the syntex and
flashing an error as “usage: Output a customized export of CommCareHQ data.
commcare-hq-export: error: unrecognized arguments: ()”.

So kindly suggest me for the correct format to get the data exported with
today’s date or now…

  1. How to combine the authenticating information in the above command line:
    Every time whenever i run the command to export the data , it require the
    username & password, during the automated process it should automatically
    run the above command without any intervention from the user so how to
    include the usrname/password in the above command.

Kindly guide me for the required steps for the above requirements.

With regards,
Gurudayal Sahu

Hi Gurudayal

The export tool does not support appending data to output files so if you
are going to be running it as part of any automated process I would suggest
exporting your data to SQL.

It could be possible to export to Excel but you would need to use a
different filename for each export run.

If you export to SQL then commcare-export will also automatically record
the date of the last successful sync and use that next time it is run so
you won’t have to supply the ‘since’ parameter via the command line.

Regarding the authentication, you can provide the username and password via
command line parameters ‘–username’ and ‘–password’.

There are more details about exporting to a SQL database on the help site:
https://help.commcarehq.org/display/commcarepublic/CommCare+Data+Export+Tool#CommCareDataExportTool-4.SavetheoutputofanexamplequerytoaSQLdatabase

Best regards
Simon

··· On 3 October 2014 12:58, Gurudayal Sahu wrote:

Dear Team,

We are planning to automate the data exporting process through the
CommCare Data Export tool by specifying the time/date functions.

But i am not able to find any options supporting for the below
requirements, so kindly need your suggestions with the below points :

  1. How to specify the scheduled date/time : I am able get the data
    exported into the excel sheet with the below command :

C:>C:\python27\scripts\commcare-export --output-format xlsx --output
C:\Users\xxxxxx\Desktop\registrations.xlsx --project emergency --query
C:\Python27\demo_registrations.xlsx --since 2013-12-05

but while i tried to replace the above date with the predefined function
such as such as : today() or now (), its not accepting the syntex and
flashing an error as “usage: Output a customized export of CommCareHQ data.
commcare-hq-export: error: unrecognized arguments: ()”.

So kindly suggest me for the correct format to get the data exported with
today’s date or now…

  1. How to combine the authenticating information in the above command
    line: Every time whenever i run the command to export the data , it require
    the username & password, during the automated process it should
    automatically run the above command without any intervention from the user
    so how to include the usrname/password in the above command.

Kindly guide me for the required steps for the above requirements.

With regards,
Gurudayal Sahu


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Kelly
Senior Engineer | Dimagi South Africa

Thanks Simon for your kind suggestion & guidance.

I will try the setup with SQl.

With regards,
Gurudayal Sahu

··· On Fri, Oct 3, 2014 at 6:05 PM, Simon Kelly wrote:

Hi Gurudayal

The export tool does not support appending data to output files so if you
are going to be running it as part of any automated process I would suggest
exporting your data to SQL.

It could be possible to export to Excel but you would need to use a
different filename for each export run.

If you export to SQL then commcare-export will also automatically record
the date of the last successful sync and use that next time it is run so
you won’t have to supply the ‘since’ parameter via the command line.

Regarding the authentication, you can provide the username and password
via command line parameters ‘–username’ and ‘–password’.

There are more details about exporting to a SQL database on the help site:
https://help.commcarehq.org/display/commcarepublic/CommCare+Data+Export+Tool#CommCareDataExportTool-4.SavetheoutputofanexamplequerytoaSQLdatabase

Best regards
Simon

On 3 October 2014 12:58, Gurudayal Sahu gurudayalsahu@gmail.com wrote:

Dear Team,

We are planning to automate the data exporting process through the
CommCare Data Export tool by specifying the time/date functions.

But i am not able to find any options supporting for the below
requirements, so kindly need your suggestions with the below points :

  1. How to specify the scheduled date/time : I am able get the data
    exported into the excel sheet with the below command :

C:>C:\python27\scripts\commcare-export --output-format xlsx --output
C:\Users\xxxxxx\Desktop\registrations.xlsx --project emergency --query
C:\Python27\demo_registrations.xlsx --since 2013-12-05

but while i tried to replace the above date with the predefined function
such as such as : today() or now (), its not accepting the syntex and
flashing an error as “usage: Output a customized export of CommCareHQ data.
commcare-hq-export: error: unrecognized arguments: ()”.

So kindly suggest me for the correct format to get the data exported with
today’s date or now…

  1. How to combine the authenticating information in the above command
    line: Every time whenever i run the command to export the data , it require
    the username & password, during the automated process it should
    automatically run the above command without any intervention from the user
    so how to include the usrname/password in the above command.

Kindly guide me for the required steps for the above requirements.

With regards,
Gurudayal Sahu


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Kelly
Senior Engineer | Dimagi South Africa


You received this message because you are subscribed to a topic in the
Google Groups “CommCare Developers” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-developers/EslLWZFkl6M/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

In continuation with the above query to export the data through APIs.

How can we customize the data by putting some condition in the input excel
query file with respect to the any of the data collected data ,

I tried to put a condition in the input excel query file under the source
field as “if(condtion, true,false)” excel syntex but its flashing an error
as

“…rser.py”, line 69, in p_error raise Exception(‘Parse error at %s:%s
near token %s (%s)’ % (t.lineno, t.col
, t.value, t.type))Exception: Parse error at 1:2 near token ( (()"

Kindly suggest.

With regards,
Gurudayal Sahu

··· On Fri, Oct 3, 2014 at 10:32 PM, Gurudayal Sahu wrote:

Thanks Simon for your kind suggestion & guidance.

I will try the setup with SQl.

With regards,
Gurudayal Sahu

On Fri, Oct 3, 2014 at 6:05 PM, Simon Kelly skelly@dimagi.com wrote:

Hi Gurudayal

The export tool does not support appending data to output files so if you
are going to be running it as part of any automated process I would suggest
exporting your data to SQL.

It could be possible to export to Excel but you would need to use a
different filename for each export run.

If you export to SQL then commcare-export will also automatically record
the date of the last successful sync and use that next time it is run so
you won’t have to supply the ‘since’ parameter via the command line.

Regarding the authentication, you can provide the username and password
via command line parameters ‘–username’ and ‘–password’.

There are more details about exporting to a SQL database on the help
site:
https://help.commcarehq.org/display/commcarepublic/CommCare+Data+Export+Tool#CommCareDataExportTool-4.SavetheoutputofanexamplequerytoaSQLdatabase

Best regards
Simon

On 3 October 2014 12:58, Gurudayal Sahu gurudayalsahu@gmail.com wrote:

Dear Team,

We are planning to automate the data exporting process through the
CommCare Data Export tool by specifying the time/date functions.

But i am not able to find any options supporting for the below
requirements, so kindly need your suggestions with the below points :

  1. How to specify the scheduled date/time : I am able get the data
    exported into the excel sheet with the below command :

C:>C:\python27\scripts\commcare-export --output-format xlsx --output
C:\Users\xxxxxx\Desktop\registrations.xlsx --project emergency --query
C:\Python27\demo_registrations.xlsx --since 2013-12-05

but while i tried to replace the above date with the predefined function
such as such as : today() or now (), its not accepting the syntex and
flashing an error as “usage: Output a customized export of CommCareHQ data.
commcare-hq-export: error: unrecognized arguments: ()”.

So kindly suggest me for the correct format to get the data exported
with today’s date or now…

  1. How to combine the authenticating information in the above command
    line: Every time whenever i run the command to export the data , it require
    the username & password, during the automated process it should
    automatically run the above command without any intervention from the user
    so how to include the usrname/password in the above command.

Kindly guide me for the required steps for the above requirements.

With regards,
Gurudayal Sahu


You received this message because you are subscribed to the Google
Groups “CommCare Developers” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Kelly
Senior Engineer | Dimagi South Africa


You received this message because you are subscribed to a topic in the
Google Groups “CommCare Developers” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-developers/EslLWZFkl6M/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Gurudayal

Please could you give me more information about what you’re trying to
accomplish with your Excel formula. I’ve also included a link to creating
Excel dashboard in case you find that useful:

https://help.commcarehq.org/display/commcarepublic/Tutorial:+Create+an+Excel+Dashboard

Simon

··· On 6 October 2014 16:53, Gurudayal Sahu wrote:

Hi,

In continuation with the above query to export the data through APIs.

How can we customize the data by putting some condition in the input excel
query file with respect to the any of the data collected data ,

I tried to put a condition in the input excel query file under the source
field as “if(condtion, true,false)” excel syntex but its flashing an error
as

“…rser.py”, line 69, in p_error raise Exception(‘Parse error at %s:%s
near token %s (%s)’ % (t.lineno, t.col
, t.value, t.type))Exception: Parse error at 1:2 near token ( (()"

Kindly suggest.

With regards,
Gurudayal Sahu

On Fri, Oct 3, 2014 at 10:32 PM, Gurudayal Sahu gurudayalsahu@gmail.com wrote:

Thanks Simon for your kind suggestion & guidance.

I will try the setup with SQl.

With regards,
Gurudayal Sahu

On Fri, Oct 3, 2014 at 6:05 PM, Simon Kelly skelly@dimagi.com wrote:

Hi Gurudayal

The export tool does not support appending data to output files so if
you are going to be running it as part of any automated process I would
suggest exporting your data to SQL.

It could be possible to export to Excel but you would need to use a
different filename for each export run.

If you export to SQL then commcare-export will also automatically record
the date of the last successful sync and use that next time it is run so
you won’t have to supply the ‘since’ parameter via the command line.

Regarding the authentication, you can provide the username and password
via command line parameters ‘–username’ and ‘–password’.

There are more details about exporting to a SQL database on the help
site:
https://help.commcarehq.org/display/commcarepublic/CommCare+Data+Export+Tool#CommCareDataExportTool-4.SavetheoutputofanexamplequerytoaSQLdatabase

Best regards
Simon

On 3 October 2014 12:58, Gurudayal Sahu gurudayalsahu@gmail.com wrote:

Dear Team,

We are planning to automate the data exporting process through the
CommCare Data Export tool by specifying the time/date functions.

But i am not able to find any options supporting for the below
requirements, so kindly need your suggestions with the below points :

  1. How to specify the scheduled date/time : I am able get the data
    exported into the excel sheet with the below command :

C:>C:\python27\scripts\commcare-export --output-format xlsx --output
C:\Users\xxxxxx\Desktop\registrations.xlsx --project emergency --query
C:\Python27\demo_registrations.xlsx --since 2013-12-05

but while i tried to replace the above date with the predefined
function such as such as : today() or now (), its not accepting the syntex
and flashing an error as “usage: Output a customized export of CommCareHQ
data.
commcare-hq-export: error: unrecognized arguments: ()”.

So kindly suggest me for the correct format to get the data exported
with today’s date or now…

  1. How to combine the authenticating information in the above command
    line: Every time whenever i run the command to export the data , it require
    the username & password, during the automated process it should
    automatically run the above command without any intervention from the user
    so how to include the usrname/password in the above command.

Kindly guide me for the required steps for the above requirements.

With regards,
Gurudayal Sahu


You received this message because you are subscribed to the Google
Groups “CommCare Developers” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Kelly
Senior Engineer | Dimagi South Africa


You received this message because you are subscribed to a topic in the
Google Groups “CommCare Developers” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-developers/EslLWZFkl6M/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Kelly
Senior Engineer | Dimagi South Africa