Hi AG Community!
I have a simple clients database (over 1000 contacts) -and I want to "extract" (preferably in CSV format) only the e-mail addresses (email field) of certain specialties (i.e.: graphic designers, art directors...).
The reason for this is an upcoming email campaign and I want to be able to send the notifications only to the certain group of people...
Can something like this be achieved by "filtering"?
****
Additional info: The email campaign will be done through online "mass mailing" service which allows CSV imports.
Thank you in advance for your help/suggestions!
Best!
Export the e-mail addresses only...
Re: Export the e-mail addresses only...
Hi,
The filtering just puts conditions on the extract, to include only the data you care about (you supply that criteria).
It sounds like for your client table you want to Export to CSV. This gets all the columns in the table so you would have to delete all the columns except the email address.
Hope that helps.
~Paul
The filtering just puts conditions on the extract, to include only the data you care about (you supply that criteria).
It sounds like for your client table you want to Export to CSV. This gets all the columns in the table so you would have to delete all the columns except the email address.
Hope that helps.
~Paul
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: Export the e-mail addresses only...
Okay so just go to tablename_view.php file and you will see a CSV field list to feed the query, make simple PHP "if statements" using memberInfo array and you're all set to have different queries for differents users groups to download custom CSV files.
Re: Export the e-mail addresses only...
Paul, thank you for the feedback!pfrumkin wrote: ↑2021-09-09 15:13Hi,
The filtering just puts conditions on the extract, to include only the data you care about (you supply that criteria).
It sounds like for your client table you want to Export to CSV. This gets all the columns in the table so you would have to delete all the columns except the email address.
Hope that helps.
~Paul
Yes, I thought about that - but this option is pretty "basic"...
I was thinking of some solution that will filter automatically - in my case - only the e-mail addresses of certain specialties...so I don't have to manually delete unnecessary data...
Re: Export the e-mail addresses only...
Thank you very much for your time!D Oliveira wrote: ↑2021-09-11 17:11Okay so just go to tablename_view.php file and you will see a CSV field list to feed the query, make simple PHP "if statements" using memberInfo array and you're all set to have different queries for differents users groups to download custom CSV files.
D. Oliveira - I'm not a PHP programmer (but I have good knowledge in HTML and I have fair knowledge of Javascript).
So, how exactly to set the filter option (for the task: filtering certain e-mail addresses and export ONLY e-mail addresses as CSV)?
...and where is this: tablename_view.php file located? (i couldn't find it)
Could you point me out to the exact PHP coding for this task?
Thank you in advance for your help!
Re: Export the e-mail addresses only...
Tablename_view.php is the shorthand for the magic hooks file for each table. Insert your table name for tablename in the filename, in your hooks folder. Take a look at https://bigprof.com/appgini/help/advanc ... agic-files.
@DOliveira thanks for that tip about the CSV hook. You said that and now I remember seeing it but I hadn't had cause to look at that hook.
~Paul
@DOliveira thanks for that tip about the CSV hook. You said that and now I remember seeing it but I hadn't had cause to look at that hook.
~Paul
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: Export the e-mail addresses only...
I believe the file you're referencing is tablename.php inside hooks folder, I am referring to tableview_view.php inside main app folder, your code should look like something close to this:pfrumkin wrote: ↑2021-09-14 15:15Tablename_view.php is the shorthand for the magic hooks file for each table. Insert your table name for tablename in the filename, in your hooks folder. Take a look at https://bigprof.com/appgini/help/advanc ... agic-files.
@DOliveira thanks for that tip about the CSV hook. You said that and now I remember seeing it but I hadn't had cause to look at that hook.
~Paul
Code: Select all
$mi = getMemberInfo();
if($mi['group']=='Admins'){
// Fields that can be displayed in the csv file
$x->QueryFieldsCSV = array(
"`tablename`.`field1`" => "Field 1",
"`tablename`.`field2`" => "Field 2",
"`tablename`.`email`" => "email",
);
}else if($mi['group']=='Users'){
// Fields that can be displayed in the csv file
$x->QueryFieldsCSV = array(
"`tablename`.`field1`" => "Field 1",
);
}
Re: Export the e-mail addresses only...
Yes of course, thanks for the check!I believe the file you're referencing is tablename.php inside hooks folder, I am referring to tableview_view.php inside main app folder