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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • "scripting" the CiviCRM export capability
Pages: [1]

Author Topic: "scripting" the CiviCRM export capability  (Read 476 times)

Erich

  • I post occasionally
  • **
  • Posts: 84
  • Karma: 1
"scripting" the CiviCRM export capability
July 06, 2011, 04:29:37 pm
To export all contacts that meet a particular search criterion (e.g. membership in a particular group) I have to do at least the following:
a) click on Search... > Find Contacts
b) specify my desired search criterion (e.g. the particular group whose members I want to export)
c) click the "Search" button
d) click the "All nnn records" radio button
e) select "Export Contacts" from the pull-down and click on "Go"
f) click on "Select fields for export"
g) select a previously-defined export profile
h) click "continue"
i) click "done"

To do this in multiple similarly-configured sites (same groups etc., but each site has its own different data) I of course have to log in to each site and repeat the above steps for each site.

I am hoping to be able to invoke the CiviCRM export via URL, but my browser reports the URL after step I above to be:
http://my.domain/index2.php?option=com_civicrm&task=civicrm/contact/search&&_qf_Map_display=true&qfKey=32-hex-digits_NNNN -- and of course I don't know what this qfKey decrypts to!

What I was hoping for was something more along the lines of "option=com_civicrm&task=civicrm/contact/search&group=group_name&export=all&profile=profile_name" or some such -- or (better yet) a way to do the export via a PHP script via the back end.

Any ideas?

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: "scripting" the CiviCRM export capability
July 07, 2011, 02:08:10 am

a few different options:

1. use selenium to script the below steps. Change the login / password /url programmatically from within your selenium script. probably the easiest and requires no code :)

2. use xaviers export script: bin/csv/export.php. U'll need to check the code / play with it and see if it meets your needs. When doing so, please consider documenting it on the wiki so others can benefit

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • "scripting" the CiviCRM export capability

This forum was archived on 2017-11-26.