Use Case: The bank statement might contain some payments, that should NOT AT ALL get into CiviCRM (e.g. salary payments).

Is there an easy way to make the importer plugin skip certain lines?

Best Detlev

  • 1
    Thanks for drawing my attention to Civibanking - looks very useful. From a quick look at the user guide docs.civicrm.org/banking/en/latest/user-guide the Analysing Stage gives an example of "the payment has nothing to do with CiviCRM" which is what I think you want.
    – Mick Kahn
    Aug 6 at 8:12
  • Thanks for your answer! However, this would work, but in this case is not enough: The bank statements contain some payments, that should never be stored within CiviCRM because they shall not be visible to unauthorized people. (i.e. CiviCRM users with access to CiviContribute and CiviBanking, but with no access to salary information). Aug 7 at 9:16
  • Looking a bit more at the extension, I don't think its possible. CiviBanking is an extension to CiviCRM so if you really don't want it in CiviCRM at all then you will need it before importing the file. A quick look at the extension doesn't seem to have any speciific CiviBanking permissions so you can't limit to a specific user, which might be acceptable. But someone properly familiar with the extension may know more so I won't call this a answer yet. Hope there is a way.
    – Mick Kahn
    Aug 7 at 17:49

Assuming that you're talking about the CSV importer, there is a configuration option called line_filter where you can provide a regular expression to skip a line if it doesn't match it. The "line" given to preg_match() is a standardized csv string. See here.

Additionally, there's also another (and even older) line filter mechanism based on the filter attribute, see here. However this approach has mostly been abandoned in favour of the more flexible regex based approach. However, it's still in the code for backwards compatibility, and there are still examples using it, see e.g. here.

  • Great - this is what I was searching for! Aug 17 at 14:15

Another way of doing this, is to operate with two bank accounts. One that is processed in CiviCRM, and one for transactions that normally shouldn’t be processed in CiviCRM. Only have the first one as bank files, and then you have solve it

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.