Project

General

Profile

Exporting Salsa for CiviCRM » History » Version 39

Jon Goldberg, 05/11/2015 01:08 PM

1 24 Jon Goldberg
{{lastupdated_at}} by {{lastupdated_by}}
2
3 1 Jon Goldberg
h1. Exporting Salsa for CiviCRM
4
5 2 Jon Goldberg
When logged in as a Manager, "Query/Export" will give you a full export of contact data.  There's a "Select My Entire List" button.  There's also an "include my deleted supporters" checkbox, which you may want to check (but probably not).  This will NOT get you groups/tags.
6 1 Jon Goldberg
7 14 Jon Goldberg
h2. Exporting Data not on the Contact Entity
8 2 Jon Goldberg
9 25 Jon Goldberg
You need to get to custom reports.  If you have the Reports tab, great; if not, you can get there by clicking "Supporter Management" tab, then "Built-in Reports", then "Clone and Edit" a report, then select "List Your Custom Reports".  Or go straight here: https://hq-org.salsalabs.com/dia/hq/reports/list.jsp?table=report
10 1 Jon Goldberg
11 8 Jon Goldberg
*Important*: When selecting foreign keys (e.g. "Supporter KEY") from the Columns tab, be sure to give a custom label.  This will cause the key to display correctly, instead of giving a link to the supporter's record.
12
13 11 Jon Goldberg
h3. Groups
14 12 Jon Goldberg
15 3 Jon Goldberg
* Create a new report.
16
* Select the type of report you would like to create: Standard report
17
* Use "Advanced Object Chooser".
18 9 Jon Goldberg
* Report "Supporter Groups", then "Groups".  Press "Save".
19 1 Jon Goldberg
* Select the "Columns" tab and select your columns.  I like just "Supporter Key" and "Group Name".
20 7 Jon Goldberg
* In Conditions, "Group Name" should be "Not Empty".
21 4 Jon Goldberg
* Save, Run the report.
22
* Click the "Export" link.
23 1 Jon Goldberg
24 11 Jon Goldberg
h3. Tags
25 12 Jon Goldberg
26 5 Jon Goldberg
* Create a new report.
27
* Select the type of report you would like to create: Standard report
28
* Use "Advanced Object Chooser".
29
* Report on "Tags", then "Tags Data", then "Database Table".  Press "Save".
30
* Select the "Columns" tab and select your columns.  I like just "Tag" and "Table Key".
31 1 Jon Goldberg
** "Table Key" is the Supporter Key.  It's similar to "entity_id" in CiviCRM.
32 7 Jon Goldberg
* In "Conditions", "Table Name" should equal "supporter".
33 10 Jon Goldberg
* Add another condition: "Tag.Tag" is "Not Empty".
34 1 Jon Goldberg
* Save, Run the report.
35
* Click the "Export" link.
36
37 11 Jon Goldberg
h3. Events
38 1 Jon Goldberg
39 15 Jon Goldberg
As above, but no conditions, and report on the "Event" table.  If you're only importing legacy events, this is a good list of easy fields to import:
40
Event KEY
41
Reference Name
42
Event Name
43
Description
44
Start
45
End
46
Deadline
47
Maximum Attendees
48 39 Jon Goldberg
Creation Date (is a useful proxy when "Start" isn't defined)
49 15 Jon Goldberg
50 1 Jon Goldberg
h3. Participants
51 16 Jon Goldberg
52
As above.  Report on tables "Supporter Event", then "Event".  Note that there are a lot of tables that _look_ like "Supporter Event", like "Supporterevent" and "Supporter Events"!
53
54
Note that if you're matching on a unique field from "Events", you can just export "Supporter Event" and not the "Event" table.
55
Here are the fields I exported and what I matched them to:
56
Supporter KEY	external_identifier
57
Event KEY	event_key
58
Status	status
59
Type	role
60
Date Created	register_date
61
62 28 Jon Goldberg
h3. Recurring Donations
63
64
Export on table "Recurring Donation".  Here's the field mapping:
65
66
Recurring Donation Key -> trxn_id
67
Supporter Key -> external_identifier
68
Transaction date -> create_date
69
Start Date -> start_date
70
RPREF -> invoice_id
71
RESULT (exclude 37, they're tests)
72
Amount -> amount
73
Pay Period -> use to remap to frequency_unit and frequency_interval
74
TERM -> installments
75
Status(?)
76
77
Note that in Salsa, there's no clear-cut way to tell whether a contact's recurring donation is still working or not - "Status" isn't a complete indicator, and thus doesn't cleanly map into Civi.
78
79 27 Jon Goldberg
h3. Donations
80
81
It's important to link the recurring donations to the donations when exporting if you need to identify the first recurring donation (e.g. to generate thank-you letters if it's a first donation and recurring).
82
83 30 Jon Goldberg
Under "Conditions", filter by "Supporter KEY is not empty" - when Salsa imports legacy data into their system, sometimes they don't do such a hot job.
84
85 29 Jon Goldberg
Export on table "Donation" linked to table "Donate Page".  You'll want these fields (more or less):
86 27 Jon Goldberg
87
Donation.donation KEY(donation)	
88 1 Jon Goldberg
Donation.supporter KEY(donation)
89 29 Jon Goldberg
donate_page.Reference_Name
90
Donation.Date_Entered
91 27 Jon Goldberg
Donation.Transaction Date(donation)
92 1 Jon Goldberg
Donation.amount(donation)
93 27 Jon Goldberg
Donation.Transaction Type(donation)
94
Donation.RESULT(donation)
95
Donation.Tracking Code(donation)
96 29 Jon Goldberg
Donation.Designation Code(donation)
97 1 Jon Goldberg
Donation.In Honor Name(donation)
98 27 Jon Goldberg
Donation.In Honor Email(donation)
99
Donation.In Honor Address(donation)
100 1 Jon Goldberg
Recurring donation.Transaction Date(recurring_donation)
101 29 Jon Goldberg
Donation.Order_Info
102 27 Jon Goldberg
103 19 Jon Goldberg
h3. Actions
104 17 Jon Goldberg
105 19 Jon Goldberg
Salsa has a separate table for actions, making them structurally comparable to Civi Events.  A good match in Civi is the Survey entity, which is used for petitions.
106 1 Jon Goldberg
107 19 Jon Goldberg
Export as above. Report on table "Action".
108
Condition: "Reference Name" is not empty.
109
110
*Note*: "Description" is likely to contain HTML that breaks the export.  I find it helpful to export it as the last column.
111
112
h3. Supporter_Actions
113 11 Jon Goldberg
114 22 Jon Goldberg
Export "action" and "supporter_action" and "supporter_action_comment" in that order.
115 23 Jon Goldberg
Condition: supporter_key IS NOT NULL
116 20 Jon Goldberg
117
Here's the fields I grabbed with their mapping:
118 22 Jon Goldberg
supporter_action.supporter_key	
119 21 Jon Goldberg
action.Reference Name
120 22 Jon Goldberg
supporter_action.Date_Created
121
supporter_action_comment.Comment	details
122 20 Jon Goldberg
123 31 Jon Goldberg
h3. Letter to the Editor
124
125
This isn't a feature CiviCRM has, but it maps reasonably well to an activity when migrating.
126
* Create a new report.
127
* Select the type of report you would like to create: Standard report
128
* Use "Advanced Object Chooser".
129
* Report "Letter Supporter", then "Letter".  Press "Save".
130
* Select the "Columns" tab and select your columns:
131
> Date_Created -> activity_date_time
132
> supporter_KEY -> external_identifier
133
> person_media_ID? -> seems important - but I can't find a matching table, and this data doesn't seem to be accessible from Salsa.
134
> Letter_Subject -> details (concatenated)
135
> Letter_Content -> details
136
> Reference_Name -> subject
137
* Save, Run the report.
138
* Click the "Export" link.
139
140 11 Jon Goldberg
h3. Chapters
141 12 Jon Goldberg
142 7 Jon Goldberg
* Create a new report.
143 1 Jon Goldberg
* Select the type of report you would like to create: Standard report
144 7 Jon Goldberg
* Use "Advanced Object Chooser".
145 8 Jon Goldberg
* Report "Supporter Chapter", then "Chapter".  Press "Save".
146
* Select the "Columns" tab and select your columns.  I like just "Supporter KEY" and "Chapter.Name".
147
* In Conditions, "Chapter.Name" should be "Not Empty".
148 5 Jon Goldberg
* Save, Run the report.
149 1 Jon Goldberg
* Click the "Export" link.
150
151 32 Jon Goldberg
h2. Programmatically creating custom fields in CiviCRM
152
153
To do this, you'll need to create a custom group, custom fields, option groups, and option values.
154
155
h3. Custom Field Group
156
157
Don't export anything from Salsa - just create this manually, or using my Kettle transform.
158
159
h3. Custom Fields, Option Groups, Option Values
160
161 33 Jon Goldberg
_Custom Columns_
162
* Create a new report.
163
* Select the type of report you would like to create: Standard report
164
* Use "Advanced Object Chooser".
165
* Report "Custom Columns".  Press "Save".
166
* Select the "Columns" tab and select your columns:
167 36 Jon Goldberg
> custom_column_key -> needed to relate to custom_column_options.  Store in filter temporarily.
168 34 Jon Goldberg
> data_table (should = supporter_custom.  In theory, we can probably export non-contact custom fields in this same process)
169 33 Jon Goldberg
> Date_Created -> created_date
170
> label -> label
171
> type -> data_type, html_type (can be bool, enum, text, varchar)
172
> Description -> help_pre
173
> Order -> weight
174 38 Jon Goldberg
> Name
175 33 Jon Goldberg
* Save, Run the report.
176 1 Jon Goldberg
* Click the "Export" link.
177 37 Jon Goldberg
* Do NOT import the Salsa name, it'll screw up Civi.
178 1 Jon Goldberg
179 35 Jon Goldberg
_Option Groups_
180 36 Jon Goldberg
These will be created automatically when you create custom fields.
181 35 Jon Goldberg
182 1 Jon Goldberg
_Custom Column Options_
183 33 Jon Goldberg
* Create a new report.
184
* Select the type of report you would like to create: Standard report
185
* Use "Advanced Object Chooser".
186
* Report "Custom Column Options".  Press "Save".
187
* Select the "Columns" tab and select your columns:
188 1 Jon Goldberg
> custom_column_KEY -> a lookup field (against civicrm_custom_field.filter to get option_group_id)
189 37 Jon Goldberg
> custom_column_option_KEY -> value
190
> value -> name
191 33 Jon Goldberg
> label -> label
192
> isDefault -> is_default
193
> isDisplayed -> is_active
194
> _Order -> weight
195
* Save, Run the report.
196
* Click the "Export" link.
197 7 Jon Goldberg
198 1 Jon Goldberg
h3. Receive_Email field
199
200 26 Jon Goldberg
Here's a TSV of how to interpret the "Receive_Email" field.
201
|*code*|*meaning*|
202
|-24|INACTIVE: (5.1.1 User Unknown)|
203
|-26|INACTIVE: Address contains RFC spec. invalid characters / is improperly formatted|
204
|-3|INACTIVE: UNSUBSCRIBED (actively unsubscribed by user)|
205
|-30|INACTIVE (Reported as Spam): Other Blacklist (BLACKLIST)|
206
|-32|(Unknown Status)|
207
|-35|INACTIVE (Reported as Spam): Outblaze|
208
|-4|(Unknown Status)|
209
|-42|INACTIVE (Recipient Initiated Spam Report): MSN/Hotmail/WebTV|
210
|-44|INACTIVE (Recipient Initiated Spam Report): UNTI (Juno/NetZero/FreeServers)|
211
|-45|INACTIVE (Recipient Initiated Spam Report): Yahoo|
212
|-46|INACTIVE (Recipient Initiated Spam Report): Comcast.net|
213
|-47|INACTIVE (Recipient Initiated Spam Report): AOL|
214
|-48|INACTIVE (Recipient Initiated Spam Report): RoadRunner|
215
|-50|ISP Specific Bounces: AIM.com Unactivated account|
216
|-51|INACTIVE (Recipient Initiated Spam Report): Excite|
217
|-52|INACTIVE (Reported as Spam): Earthlink|
218
|-53|(Unknown Status)|
219
|-54|(Unknown Status)|
220
|-60|Bad Address/Expired address, etc (n.b.: These addresses are all @democracyinaction.org)|
221
|-9|INACTIVE: DEATH (supporter has died)|
222
|0|0 - Inactive or Unknown(not subscribed)|
223
|1|1 - Imported or unknown (subscribed)|
224
|10|ACTIVE: CONFIRMED (Double opt-in)|
225 1 Jon Goldberg
|3|ACTIVE: CLIENT (Client has directly signed up)|
Go to top