We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: CSVee

Development and Programming

techops's avatar
techops
18 posts
16 years ago
techops's avatar techops

Great plugin!

Any way to have it only pull the “latest entries” since the last time the plugin was called? I’m using this with FreeForm…

I want to use this to send the entries to a fulfillment center in which they can easily check the list for people who signed up to receive a free kit and see who has signed up since the last time they checked? This way they don’t pull the data and have duplicates sent out?

       
Daniel Walton's avatar
Daniel Walton
553 posts
16 years ago
Daniel Walton's avatar Daniel Walton
Great plugin! Any way to have it only pull the “latest entries” since the last time the plugin was called? I’m using this with FreeForm… I want to use this to send the entries to a fulfillment center in which they can easily check the list for people who signed up to receive a free kit and see who has signed up since the last time they checked? This way they don’t pull the data and have duplicates sent out?

There are a couple options for you, i’ll list them here in difficulty order ascending:

1) Ensure only 1 user has access to the template, and that every time that user logs in, he calls up the template and downloads the file. You could then run a query that collects each entry since the ‘last_visit_date’ of the member account. Of course, this is prone to error, since he could login and forget to download if, say, he was also editing some site entries/other tasks etc.

2) Create a table in your database named, i don’t know, something like “template_last_access”. You’d want columns like “id”, “template_id”, “last_visit” etc. You could then create a simple (ish) plugin to also put on that template which grabs the current template id and date and stores/updates that in its own table. CSVee would need to be run before this other plugin, naturally. This is not prone to any error, at least in any logical sense. Php errors ahoy of course.

       
Geoff Towle's avatar
Geoff Towle
330 posts
16 years ago
Geoff Towle's avatar Geoff Towle

Daniel-

Thanks for sharing this plug-in!

I’m having one problem - the code doesn’t seem to work whenever I try to use the group_id parameter. I even tested it with a very basic query, to no avail. I want to restrict to groups 5|8|9|10. Some of those groups are empty, so I thought that was the problem and tested using only group 5 in the parameter, but it still doesn’t work.

Here is my code:

{exp:csvee query="SELECT
exp_members.member_id, 
exp_member_data.m_field_id_2 AS 'First Name', 
exp_member_data.m_field_id_3 AS 'Last Name', 
exp_member_data.m_field_id_7 AS 'Department', 
exp_member_data.m_field_id_8 AS 'Title', 
exp_member_data.m_field_id_9 AS 'Address 2', 
exp_member_data.m_field_id_10 AS 'City', 
exp_member_data.m_field_id_11 AS 'State', 
exp_member_data.m_field_id_12 AS 'ZIP', 
exp_member_data.m_field_id_13 AS 'Phone', 
exp_member_data.m_field_id_14 AS 'Blank', 
exp_member_data.m_field_id_15 AS 'Institution', 
exp_member_data.m_field_id_16 AS 'Address' 
FROM exp_members, exp_member_data WHERE exp_members.member_id = exp_member_data.member_id "
fixed_width="200"
group_id="5"}

Thanks.

       
Daniel Walton's avatar
Daniel Walton
553 posts
16 years ago
Daniel Walton's avatar Daniel Walton

Do you get any PHP errors on page or within the file?

       
Geoff Towle's avatar
Geoff Towle
330 posts
16 years ago
Geoff Towle's avatar Geoff Towle

None that are apparent. Do I need to have debugging turned on?

All that happens is nothing; I navigate to the URL of the template and nothing.

       
Daniel Walton's avatar
Daniel Walton
553 posts
16 years ago
Daniel Walton's avatar Daniel Walton

And you are logged in as a member of group_id 5, when visiting the template?

       
Geoff Towle's avatar
Geoff Towle
330 posts
16 years ago
Geoff Towle's avatar Geoff Towle

No, SuperAdmin. Maybe I’m misunderstanding what that parameter does. I thought it would only export the groups that are identified in the parameter. That’s what I was trying to accomplish.

       
Todd D.'s avatar
Todd D.
460 posts
16 years ago
Todd D.'s avatar Todd D.

I just wanted to post a ‘thank you’ to the author, Daniel, of this plug-in.

It’s great when your boss asks you if you can export data out of ee for import into Excel and you follow with… ‘No problem’.

This plug-in makes it all too easy.

       
Daniel Walton's avatar
Daniel Walton
553 posts
16 years ago
Daniel Walton's avatar Daniel Walton
No, SuperAdmin. Maybe I’m misunderstanding what that parameter does. I thought it would only export the groups that are identified in the parameter. That’s what I was trying to accomplish.

You will need to manually specify that in your query string - the other parameters control other aspects of the functionality.

I just wanted to post a ‘thank you’ to the author, Daniel, of this plug-in. It’s great when your boss asks you if you can export data out of ee for import into Excel and you follow with… ‘No problem’. This plug-in makes it all too easy.

Thank you, you’re welcome!

       
jamesa's avatar
jamesa
75 posts
about 16 years ago
jamesa's avatar jamesa

i’m looking to export entries into a csv file from freeform - without having to use a blank template,

would this require writing custom functionality or can this plugin be used in some way?

Thanks, James

       
stinhambo's avatar
stinhambo
1,268 posts
15 years ago
stinhambo's avatar stinhambo

This is an awesome plugin!

I created a Quick Link to the template and it works so well.

       
sm9's avatar
sm9
352 posts
15 years ago
sm9's avatar sm9

Hi there,

First of all, thanks for the plugin! I’m always being asked about exporting data out of EE and this makes it much easier.

At the moment though, I’m finding that the output of the CSV file is loading in my browser (in Safari 4 it is anyway). I then go to Save As to save the CSV file and this works fine.

How can I make the CSV file automatically download to the user’s computer as a downloadable csv file? (i.e. where Windows will prompt the user to save the file to disk/or save to the Downloads folder on a Mac)

I’ve been playing around with the save_path and redirect parameters but can’t seem to get this to work, and I can’t get the save_path to do anything other than give me a php error about permissions.

Here’s my current code for info:

{exp:csvee 
filename="my-export.csv"
query="SELECT 
exp_weblog_titles.title as name,
exp_weblog_data.field_id_126 as telephone,
exp_weblog_data.field_id_127 as fax,
exp_weblog_data.field_id_128 as email
FROM exp_weblog_data 
INNER JOIN exp_weblog_titles ON exp_weblog_data.entry_id = exp_weblog_titles.entry_id 
WHERE exp_weblog_data.weblog_id='4' 
ORDER BY exp_weblog_titles.title ASC"}

Thanks for any help with this.

       
stinhambo's avatar
stinhambo
1,268 posts
15 years ago
stinhambo's avatar stinhambo
How can I make the CSV file automatically download to the user’s computer as a downloadable csv file? (i.e. where Windows will prompt the user to save the file to disk/or save to the Downloads folder on a Mac)

I believe this is a browser behaviour.

       
sm9's avatar
sm9
352 posts
15 years ago
sm9's avatar sm9

Thanks.

Do you know the correct syntax for the save_path setting at all? I seem to have tried all sorts of combinations, and ensuring the folder is set to 777 permissions, but with no luck.

Thanks.

       
Daniel Walton's avatar
Daniel Walton
553 posts
15 years ago
Daniel Walton's avatar Daniel Walton

There appeared to be a minor bug in the code. Please re-download the archive.

Syntax is fairly straightforward - pass the full server path to the directory:

save_path=”/home/me/my_website/example/”;

(Note: trailing slash!)

       
First 4 5 6 7 8

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.