I am looking for a way to mark data as exported in some way.

The scenario is that we are receiving and capturing data for enquirers (people making enquiries) on behalf of a third party.

The 3rd party doesn't have access to the system (and are not allowed to be given log in - apparently this is a 'politics' reason) however need to be given an extract of all the people who have made contact in the last 24 hours.

Ideally I would like to pull a report (automatically generate a CSV file perhaps) but mark the data in some way with an exported flag or date so we can show it has been exported.

Any suggestion as to how I could do this?

(Open to other suggestions such as an export that sets an activity as completed or something too, or something that can be developed by the API)

  • if you are pulling a report then better to use date range - which will give you only for the selected date. so you can run everyday – Ramesh - ARTECH Consultancy Jan 8 at 13:08

How are you recording the enquiry? As an activity? If so, you could add a custom field "exported" (Yes/No field, default No), then search for exported=no, export, and update exported=yes.

There are various problem scenarios you might want to think about: eg if an export is lost after you generate it (eg email bounces), do you need to be able to reproduce an export? How important is it to make sure you export every enquiry once, and once only? If you need a robust process you could take a look at how Accounting Batches manages exports of contributions.


This Log Export extension "logs to a files within the ConfigandLog directory whenever an export happens, who performed it what columns involved and the relevant entity IDs"

There is a blog about it here

  • I read the question as asking a different question - they want to be able to locate a subset of stuff added/edited in civicrm in the last 24 hours. That extension seems to serve a different purpose? – Demerit Jan 17 at 19:54
  • Oh I see. You could use it as a way of making "24 hours" more exact, so that you're searching for changes since the last export. – Demerit Jan 17 at 20:06
  • i agree it is a bit of a tangential answer but had just come across the link again and remembered a couple of Q+A on here that it might be helpful to - even if only for others reading the Q rather than the original poster. – petednz - fuzion Jan 18 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.