Support » Plugin: Contact Form DB » Exporting based on certain values

  • I am struggling to export certain database values entered by the contact form.

    My contact form is for real estate enquiries, such as:
    name, email, buying/selling, enquiry type (e.g house, land), location (e.g america, africa, new zealand), subject, and message.

    What I am wanting to do is export emails only for different variables.
    An example would be I want to get the email for people wanting to buy, house, in america.

    I have got to the stage where I can get e.g email for, “buying”, but when I add more filters it just includes all listed locations no matter if its a house or unit.

    an example of the filter is:
    the results given can be correct, but it will show emails from people who are also “selling” if the locations are there.

    I have no idea if the filter is capable of doing this, I am only using the “database short code” page and the filter towards the bottom.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Michael Simpson


    The AND and OR logic computes as:

    (Buying&&House=House&&America=America ) || Africa=Africa

    So if the Africa=Africa evaluates to true, then the whole filter is true and the row is shown.

    wow thanks so much,I get it now, its been doing my head in! Very much appreciated feedback 🙂

    Is there a way to work with it so I can use the OR within the AND.

    e.g If I want to get the emails for multiple locations not exactly both, but either.

    Plugin Author Michael Simpson


    Unfortunately the boolean logic cannot be grouped by paratheses which limits how much you can express.

    So in a mixed AND and OR expression, ANDs get evaluated first and ORs last. This is standard convention. It is analogous to mathematical expressions where you would think of AND like multiplication and OR as addition.

    So a an expression like
    A || B && C || D = A || (B&&C) || D
    evaluates in analogous way to
    A + B x C + D = A + (BxC) + D

    But if you wanted something to evaluate like
    (A||B) && (C||D)
    You would need the parentheses and that is not currently supported

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exporting based on certain values’ is closed to new replies.