Commcare-export tool and Map Via

Hello. I'm using the commcare-export tool to download form and case data
from the CommCareHQ site. In the documentation for the export tool, it
mentions the ability to use the Map Via column to map fields into different
data types. I'm currently using str2date for date fields in my forms and it
is working well. However, when I use the same syntax to map date fields in
cases, it doesn't work. Is this a bug or is the Map Via column only
applicable to forms? I attached the Excel sheet I am using for reference.
Thanks.

The documentation is found here:
https://confluence.dimagi.com/display/commcarepublic/CommCare+Data+Export+Tool#CommCareDataExportTool-E.TypeSupport

bednet_case_query.xlsx (9.99 KB)

Hi

There shouldn't be any difference between cases and forms. I've done a few
tests and didn't find any issues but if you could give me some more
information I can look into it more closely:

  • what format are you exporting to e.g. xls / xlsx / csv / sql?
  • which fields don't seem to be working (or is it all of the date
    fields)?

Simon

··· On 11 January 2016 at 17:51, wrote:

Hello. I'm using the commcare-export tool to download form and case data
from the CommCareHQ site. In the documentation for the export tool, it
mentions the ability to use the Map Via column to map fields into different
data types. I'm currently using str2date for date fields in my forms and it
is working well. However, when I use the same syntax to map date fields in
cases, it doesn't work. Is this a bug or is the Map Via column only
applicable to forms? I attached the Excel sheet I am using for reference.
Thanks.

The documentation is found here:
CommCare Data Export Tool - CommCare Public - CommCare Public

--
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
Senior Engineer | Dimagi South Africa

Hi Simon,

I am exporting to a PostgreSQL database. None of the five date fields seem
to be working for me (date_opened, date_closed, date_modified,
server_date_opened, server_date_modified). Thanks for looking into this.

-Jared

··· On Tuesday, January 12, 2016 at 2:36:06 AM UTC-5, skelly wrote: > > Hi > > There shouldn't be any difference between cases and forms. I've done a few > tests and didn't find any issues but if you could give me some more > information I can look into it more closely: > > - what format are you exporting to e.g. xls / xlsx / csv / sql? > - which fields don't seem to be working (or is it all of the date > fields)? > > Simon > > On 11 January 2016 at 17:51, <jol...@nd.edu > wrote: > >> Hello. I'm using the commcare-export tool to download form and case data >> from the CommCareHQ site. In the documentation for the export tool, it >> mentions the ability to use the Map Via column to map fields into different >> data types. I'm currently using str2date for date fields in my forms and it >> is working well. However, when I use the same syntax to map date fields in >> cases, it doesn't work. Is this a bug or is the Map Via column only >> applicable to forms? I attached the Excel sheet I am using for reference. >> Thanks. >> >> The documentation is found here: >> https://confluence.dimagi.com/display/commcarepublic/CommCare+Data+Export+Tool#CommCareDataExportTool-E.TypeSupport >> >> -- >> 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-user...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Simon Kelly > Senior Engineer | Dimagi South Africa >

Hi Jared

I've run some more tests and still can't reproduce any error. One thing to
note though is that if the SQL table you're exporting to was already
created then the export tool won't change any of the data types. So if the
date columns were created as VARCHAR then they will stay that way.

I would suggest running the export on a non-existent table and let the
export tool create it. The easiest way to do this is to change the name of
the Excel sheet which is what gets used as the table name. If that still
doesn't work please could you send an email to commcare-support@dimagi.com
or create an issue on CommCare HQ and include the following details:

  • PostgreSQL version
  • CommCare HQ project name

Thanks
Simon

··· On 12 January 2016 at 15:37, wrote:

Hi Simon,

I am exporting to a PostgreSQL database. None of the five date fields seem
to be working for me (date_opened, date_closed, date_modified,
server_date_opened, server_date_modified). Thanks for looking into this.

-Jared

On Tuesday, January 12, 2016 at 2:36:06 AM UTC-5, skelly wrote:

Hi

There shouldn't be any difference between cases and forms. I've done a
few tests and didn't find any issues but if you could give me some more
information I can look into it more closely:

  • what format are you exporting to e.g. xls / xlsx / csv / sql?
  • which fields don't seem to be working (or is it all of the date
    fields)?

Simon

On 11 January 2016 at 17:51, jol...@nd.edu wrote:

Hello. I'm using the commcare-export tool to download form and case data
from the CommCareHQ site. In the documentation for the export tool, it
mentions the ability to use the Map Via column to map fields into different
data types. I'm currently using str2date for date fields in my forms and it
is working well. However, when I use the same syntax to map date fields in
cases, it doesn't work. Is this a bug or is the Map Via column only
applicable to forms? I attached the Excel sheet I am using for reference.
Thanks.

The documentation is found here:
CommCare Data Export Tool - CommCare Public - CommCare Public

--
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-user...@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 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
Senior Engineer | Dimagi South Africa

Hi Simon,

I am able to get it to work now. I was expecting it to update the datatype
in the database. Thanks for your clarification on the issue.

-Jared

··· On Tuesday, January 12, 2016 at 2:18:44 PM UTC-5, skelly wrote: > > Hi Jared > > I've run some more tests and still can't reproduce any error. One thing to > note though is that if the SQL table you're exporting to was already > created then the export tool won't change any of the data types. So if the > date columns were created as VARCHAR then they will stay that way. > > I would suggest running the export on a non-existent table and let the > export tool create it. The easiest way to do this is to change the name of > the Excel sheet which is what gets used as the table name. If that still > doesn't work please could you send an email to commcare...@dimagi.com > or create an issue on CommCare HQ and include the following > details: > > - PostgreSQL version > - CommCare HQ project name > > Thanks > Simon > > On 12 January 2016 at 15:37, <jol...@nd.edu > wrote: > >> Hi Simon, >> >> I am exporting to a PostgreSQL database. None of the five date fields >> seem to be working for me (date_opened, date_closed, date_modified, >> server_date_opened, server_date_modified). Thanks for looking into this. >> >> -Jared >> >> >> On Tuesday, January 12, 2016 at 2:36:06 AM UTC-5, skelly wrote: >>> >>> Hi >>> >>> There shouldn't be any difference between cases and forms. I've done a >>> few tests and didn't find any issues but if you could give me some more >>> information I can look into it more closely: >>> >>> - what format are you exporting to e.g. xls / xlsx / csv / sql? >>> - which fields don't seem to be working (or is it all of the date >>> fields)? >>> >>> Simon >>> >>> On 11 January 2016 at 17:51, wrote: >>> >>>> Hello. I'm using the commcare-export tool to download form and case >>>> data from the CommCareHQ site. In the documentation for the export tool, it >>>> mentions the ability to use the Map Via column to map fields into different >>>> data types. I'm currently using str2date for date fields in my forms and it >>>> is working well. However, when I use the same syntax to map date fields in >>>> cases, it doesn't work. Is this a bug or is the Map Via column only >>>> applicable to forms? I attached the Excel sheet I am using for reference. >>>> Thanks. >>>> >>>> The documentation is found here: >>>> https://confluence.dimagi.com/display/commcarepublic/CommCare+Data+Export+Tool#CommCareDataExportTool-E.TypeSupport >>>> >>>> -- >>>> 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-user...@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 the Google Groups >> "commcare-users" group. >> 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 > Senior Engineer | Dimagi South Africa >

Great. I'm glad you got it to work.

··· On 14 January 2016 at 23:03, wrote:

Hi Simon,

I am able to get it to work now. I was expecting it to update the datatype
in the database. Thanks for your clarification on the issue.

-Jared

On Tuesday, January 12, 2016 at 2:18:44 PM UTC-5, skelly wrote:

Hi Jared

I've run some more tests and still can't reproduce any error. One thing
to note though is that if the SQL table you're exporting to was already
created then the export tool won't change any of the data types. So if the
date columns were created as VARCHAR then they will stay that way.

I would suggest running the export on a non-existent table and let the
export tool create it. The easiest way to do this is to change the name of
the Excel sheet which is what gets used as the table name. If that still
doesn't work please could you send an email to commcare...@dimagi.com or
create an issue on CommCare HQ and include the following details:

  • PostgreSQL version
  • CommCare HQ project name

Thanks
Simon

On 12 January 2016 at 15:37, jol...@nd.edu wrote:

Hi Simon,

I am exporting to a PostgreSQL database. None of the five date fields
seem to be working for me (date_opened, date_closed, date_modified,
server_date_opened, server_date_modified). Thanks for looking into this.

-Jared

On Tuesday, January 12, 2016 at 2:36:06 AM UTC-5, skelly wrote:

Hi

There shouldn't be any difference between cases and forms. I've done a
few tests and didn't find any issues but if you could give me some more
information I can look into it more closely:

  • what format are you exporting to e.g. xls / xlsx / csv / sql?
  • which fields don't seem to be working (or is it all of the date
    fields)?

Simon

On 11 January 2016 at 17:51, jol...@nd.edu wrote:

Hello. I'm using the commcare-export tool to download form and case
data from the CommCareHQ site. In the documentation for the export tool, it
mentions the ability to use the Map Via column to map fields into different
data types. I'm currently using str2date for date fields in my forms and it
is working well. However, when I use the same syntax to map date fields in
cases, it doesn't work. Is this a bug or is the Map Via column only
applicable to forms? I attached the Excel sheet I am using for reference.
Thanks.

The documentation is found here:
CommCare Data Export Tool - CommCare Public - CommCare Public

--
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-user...@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 the Google
Groups "commcare-users" group.
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
Senior Engineer | Dimagi South Africa

--
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
Senior Engineer | Dimagi South Africa