CommCare Data Export Tool

383 views
Skip to first unread message

Hakan Berk

unread,
Feb 17, 2017, 11:53:56 AM2/17/17
to commcare-users
Hi,

I was using the CommCare Data Export Tool found here and I had a couple questions. My goal is to be able to get CommCare to automatically put daily exports into a folder in a specific directory on my computer. 

In my attempt to implement it, here my questions so far: 

1) In the --query command is it required to have downloaded the spreadsheet? If I have to do this everyday, the process won't be automated. I also tried using the download link address, but that did not seem to work.

2) In the picture attached, I am simply just trying to put the excel spreadsheet in the same directory (I will later put it in another the goal directory), but I am receiving an error message I am not sure how to deal with. I appreciate any help on figuring out what is wrong with the cmd line prompt I wrote and why the output spreadsheet won't be placed in the same directory. 

I appreciate your help in answering these questions, 

Hakan 


1.PNG

Simon Kelly

unread,
Feb 20, 2017, 8:58:29 AM2/20/17
to commcar...@googlegroups.com
HI Hakan

The "--query" parameter is what tells the tool what to download and what columns to export. That file shouldn't need to change so you should be able to keep that the same.

The error message you're getting is because your query file is missing the "Data Source" column.

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



--
Simon Kelly
Director of Server Engineer | Dimagi

Hakan Berk

unread,
Feb 20, 2017, 10:20:35 AM2/20/17
to commcare-users
Does the Data Source column not come with the Daily Export? 

If not and I have to create a column, how would I automate this process so I can export to a specific folder daily? 

Thanks,

Hakan 
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Simon Kelly

unread,
Feb 21, 2017, 8:26:36 AM2/21/17
to commcar...@googlegroups.com
Hi Hakan

I think you may be confusing the tools. The CommCare Data Export Tool requires an Excel configuration file which you have to create manually. Here's an example config file for exporting forms: https://github.com/dimagi/commcare-export/blob/master/examples/demo-registrations.xlsx?raw=true

I'd recommend that you read through the wiki page which has instructions on the configuration file: https://confluence.dimagi.com/display/commcarepublic/CommCare+Data+Export+Tool#CommCareDataExportTool-C.ExcelConfigurationDetails

To unsubscribe from this group and stop receiving emails from it, send an email to commcare-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hakan Berk

unread,
Feb 24, 2017, 11:25:13 AM2/24/17
to commcare-users
Thanks for bringing up that clarification. 

I was able to run the data export with your sample file, but when I tried to set up my own excel file it did not seem to work. There are two attached screenshots. One of them displays what I put in my spreadsheet, the other is the output from the command window. 

The command window line data_source_str = get_column_by_name(worksheet, 'data source')[0].value seems to be returning null? I don't understand why it would do that if I put "form" under my data source. 

Could you let me know what I am doing wrong with the configuration of the excel file?

Thanks,

Hakan 
01.PNG
02.png

Hakan Berk

unread,
Feb 24, 2017, 11:30:09 AM2/24/17
to commcare-users
What doesn't make sense to me is that I just put my form URL into the demo-registration.xlsx and it worked. So that isn't the problem and I'm not sure what else it could be. 

Thanks,

Hakan 

Hakan Berk

unread,
Feb 24, 2017, 11:57:55 AM2/24/17
to commcare-users
Sorry for the bunch of questions, just really trying to understand how this works. 

How does the scheduling of this process work? Every time I run it, I am asked for my username / password. If I was to set up a scheduler to do this everyday, even when I'm not at the computer would it still work or would it require username / password? 

Thanks,

Hakan 

Simon Kelly

unread,
Mar 1, 2017, 5:57:08 AM3/1/17
to commcar...@googlegroups.com
HI Hakan

I'm not sure why you're getting that error. It does look like it has the right information in it. 

Regarding the scheduling, you can supply the username and password via command line options. Run "commcare-export --help" to see the full list of options.

To unsubscribe from this group and stop receiving emails from it, send an email to commcare-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages