CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCampaign (Moderators: Kiran Jagtap, xavier) »
  • importing survey responses
Pages: [1]

Author Topic: importing survey responses  (Read 1119 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
importing survey responses
April 17, 2012, 10:15:48 pm
I'm looking on 4.0 & can see that fields relevant to importing survey responses are not available - relevant custom fields, result, survey id.

Has there been any changes since 4.0?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: importing survey responses
April 18, 2012, 07:01:03 am

No. But this has been on PTP's recent wishlist. Wanna work on it?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: importing survey responses
April 18, 2012, 01:26:58 pm
Not sure yet - client still doing discovery on surveys
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: importing survey responses
May 09, 2012, 05:01:05 pm
I took a look into this & setting import to true in the xml was all that was required to make this work - is there a down side to this. (Nb the custom fields mentioned above was a red herring).

Code: [Select]
Index: xml/schema/Activity/Activity.xml
===================================================================
--- xml/schema/Activity/Activity.xml (revision 40228)
+++ xml/schema/Activity/Activity.xml (working copy)
@@ -47,6 +47,8 @@
       <name>source_record_id</name>
       <type>int unsigned</type>
       <comment>Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry.</comment>
+      <title>Survey ID</title>
+      <import>true</import>
       <add>2.0</add>
   </field>
   <index>
@@ -325,6 +327,7 @@
        <type>varchar</type>
        <title>Result</title>
        <length>255</length>
+       <import>true</import>
        <comment>Currently being used to store result id for survey activity, FK to option value.</comment>
        <add>3.3</add>
   </field>
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: importing survey responses
May 09, 2012, 07:06:16 pm
Feedback from dgg

Quote
(12:27:09 PM) dgg: eileen: i see one problem with that patch - which is that source_record_id is used to "key" to many different record types (not just survey)
so you'd def need to use "Source Record ID" for <title>


(12:27:49 PM) eileen: dgg - yep- I wasn't clear about that - but you think it's OK if I use that title?


(12:28:28 PM) dgg: eileen: fyi - that column holds contribution.id, membership.id etc. depending on how the activity was created
other than that - make sure it doesn't break export
of activities


(12:29:26 PM) eileen: hmm - I suspect that without defining export as true it won't be available?


(12:29:52 PM) dgg: … not sure, there's a hierarchy between import and export which i don't remember which direction
 so one implies the other as i recall
so check that, and also see if doing that exposes those as profile fields
 other than that, have u tested the row validation for those fields? what happens if I reference a non-existent survey.ID value?
 or a non-existent result value


I tested & the fields are not available for export by virtue of being added to import. With regards validation - I think it's not being validated - but I also see that status_id is dropped if non-existant.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCampaign (Moderators: Kiran Jagtap, xavier) »
  • importing survey responses

This forum was archived on 2017-11-26.