Title: Filter issues with cfdb-export-link
Last modified: August 31, 2016

---

# Filter issues with cfdb-export-link

 *  Resolved [andywt](https://wordpress.org/support/users/andywt/)
 * (@andywt)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/filter-issues-with-cfdb-export-link/)
 * To produce a specific report I wrote a custom function to determine idf the record
   has an email. The function works fine with the cfdb-datatable but when I use 
   the same filter in an cfdb-exportlink, it does not work. Here is the short code
   that works with the datatable:
 *     ```
       [cfdb-datatable  form="2015 Flag Database"  edit="$_GET(edit)" show="FirstName,LastName,Email,HouseNumber,Street,UniqueID, Renew_status" trans="NaturalSortByMultiField($_GET(sortBy1),$_GET(sortBy2),$_GET(sortBy3),$_GET(sortBy4),$_GET(sortBy5))"
       filter="has_valid_email()&&Route>=$_GET(routeS)&&Route<=$_GET(routeE)&&Renew_status!=Renewed&&Renew_status!=Removed"
       ```
   
 * Now here is the same code for the export-link:
 *     ```
       [cfdb-export-link  form="Flag Database"  edit="$_GET(edit)" show="FirstName,LastName,Email,HouseNumber,Street,UniqueID, Renew_status" trans="NaturalSortByMultiField($_GET(sortBy1),$_GET(sortBy2),$_GET(sortBy3),$_GET(sortBy4),$_GET(sortBy5))"  filter="has_valid_email()"  filter="has_valid_email()&&Route>=$_GET(routeS)&&Route<=$_GET(routeE)&&Renew_status!=Renewed&&Renew_status!=Removed"    ]
       ```
   
 * When the export-link is executed it returns no data. If I remove the custom function
   in the filter it does return data.
 * [https://wordpress.org/plugins/contact-form-7-to-database-extension/](https://wordpress.org/plugins/contact-form-7-to-database-extension/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/filter-issues-with-cfdb-export-link/#post-7172041)
 * 2nd short code
    – References a different form name – You have 2 “filter” entries–
   In “show you have a space in ” Renew_status” – Can remove “edit” option
 * Can’t compare short codes with different options.
 *  Thread Starter [andywt](https://wordpress.org/support/users/andywt/)
 * (@andywt)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/filter-issues-with-cfdb-export-link/#post-7172051)
 * Michael,
    Sorry I posted the wrong second short code. To create the the export
   shortcode, I copied the datatable in total and changed cfdb-datable to cfdb-export-
   table. My new code did have edit and it did have the space before Renew_status
   as that worked fine with the datatable. I removed the edit and the extra space
   and this is the shortcode: `[cfdb-export-link form="2015 Flag Database" show="
   FirstName,LastName,Email,HouseNumber,Street,UniqueID,Renew_status" trans="NaturalSortByMultiField(
   $_GET(sortBy1),$_GET(sortBy2),$_GET(sortBy3),$_GET(sortBy4),$_GET(sortBy5))" 
   filter="has_valid_email()&&Route>=$_GET(routeS)&&Route<=$_GET(routeE)&&Renew_status!
   =Renewed&&Renew_status!=Removed" ]`
 * This does not return any values in the CSV file. If I remove “has_valid_email()”
   from the filter results are returned.
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/filter-issues-with-cfdb-export-link/#post-7172062)
 * And if you change cfdb-export-link to cfdb-datatable (with all the same options)
   then you do get results?
 *  Thread Starter [andywt](https://wordpress.org/support/users/andywt/)
 * (@andywt)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/filter-issues-with-cfdb-export-link/#post-7172063)
 * Yes.
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/filter-issues-with-cfdb-export-link/#post-7172066)
 * OK, I think I know what is going on. The export link is an admin (Dashboard) 
   page URL. So go to where you created your custom function in [SAF](https://wordpress.org/plugins/add-actions-and-filters/),
   check the “Execute also on Dashboard Pages” box and save.
 *  Thread Starter [andywt](https://wordpress.org/support/users/andywt/)
 * (@andywt)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/filter-issues-with-cfdb-export-link/#post-7172067)
 * Victory!! That was it. Thanks much.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Filter issues with cfdb-export-link’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-to-database-extension_ffffff.
   svg)
 * [Contact Form DB](https://wordpress.org/plugins/contact-form-7-to-database-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-to-database-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [andywt](https://wordpress.org/support/users/andywt/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/filter-issues-with-cfdb-export-link/#post-7172067)
 * Status: resolved