Page MenuHomePhabricator

Import for appeal/package codes
Closed, ResolvedPublic

Description

We currently need to hand enter the appeal/package codes for each Direct Mail mailing and would like to automate this with an import. These are under the Custom Fields part of Civi. We would want the following fields in the import:

  • Label
  • Value
  • Description

Screenshot 2025-11-24 at 12.00.17 PM.png (762×1 px, 119 KB)

There are over 100 package codes for the November mailing so if we could get this set up by 12/8 when we will likely start seeing returns come in with these codes that would be great. This has never come previously because this is the first time having this many codes. If not, we would still like this capability for the future.

DM coding doc for reference: https://docs.google.com/spreadsheets/d/12E36Pprlr6aZpX45m1EnexlNDj4ZI_BR/edit?gid=579754243#gid=579754243

Event Timeline

Lars triaged this task as Medium priority.Nov 24 2025, 8:55 PM

If you have a list is should be possible to import them.... over at https://civicrm.wikimedia.org/civicrm/import/option_value - although it looks like we need to expose more fields to import

image.png (257×418 px, 18 KB)

@MDemosWMF Can you prepare two CSVs for this, one each for Packages and Appeals, with three columns: Label, Value, Description. Label and Value would be the same.

@Lars Here are the two files. All of the appeal codes are already in Civi, but I created a file as an example in case it is helpful for setup.

@MDemosWMF The November Package codes.csv file has the incorrect (old-style MacOS) line endings in it again, as we saw where you had that file that wouldn't import earlier. Which program are you using to create these files?

@MDemosWMF and if it is Excel, are you doing File -> Save As ... -> csv?

There's an additional problem with this one in that the link to use the import template looks like https://civicrm.wikimedia.org/civicrm/import/%?reset=1&template_id=3648 when it should be https://civicrm.wikimedia.org/civicrm/import/option_value?reset=1&template_id=3648 (i.e. we have % instead of option_value).

@MDemosWMF I have imported the packages in your file, but it looks like 30 of them already existed: https://civicrm.wikimedia.org/civicrm/search#/display/Import_3653/Import_3653
You might note there is one less rows than your original file, which is because I imported that one separately to test.

@MDemosWMF I've split the incorrect url issue above off into T411438: Add correct links for generic imports to Import Templates SearchKit, so we can work on a general solution for all imports.
In the meantime, you can just go to https://civicrm.wikimedia.org/civicrm/import/option_value and select the template there instead of using the Import Template report.

@Lars Thanks this is a big help! Will note that link to import future appeal/package codes.

I'm not sure what is happening with the file type there. I think what I did was copy/paste the codes and descriptions into a new excel file and then save as .csv? Looks like I might've accidentally saved it as the Mac .csv and not the one I have checked below which I usually choose.

Screenshot 2025-12-02 at 12.51.49 PM.png (672×710 px, 111 KB)

@MDemosWMF Could be the Mac CSV thing, you definitely don't want that (hasn't been a thing for decades).

XenoRyet set Final Story Points to 4.