The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Exporting a CSV of entries by a user to Google Spreadsheets ??

Labels

This Discussion is public

Notifications

Hi

I have a site which allows a logged in user to download a CSV file of all entries created under that user from the front end of my site (when a user is logged in).

I use the following code to allow a user to download their CSV file of all entries:

.../wp-admin/admin-ajax.php?frm_action=0&action=frm_entries_csv&form=5&s=1&fid=user_id

It works well. (using "user_id" allows for generic download of any current logged in user) I also want to allow users though, (who have a Google DOCS account) to be able to automatically import their CSV file into Google Spreadsheets. I've tried the following code (which a user would add to a blank spreadsheet in the first cell on a Google spreadsheet):

=importData(".../wp-admin/admin-ajax.php?frm_action=0&action=frm_entries_csv&form=5&s=1&fid=user_id)”)

Unfortunately, Google spreadsheets tries to import the user's CSV Formidable file - but then returns the error. "Does not have permission"

I assume the above code would need log in information as well...?

Because different logged in users may want to import their CSV files into Google spreadsheets - therefore the permission/login code would need to be generic - perhaps "current_user" ????Or will it not work at all...?

Any help. most appreciated...

What you want to do won't work. Google docs requires a login to create spreadsheets. With 2-factor authentication available these days, you can't even rely on a regular user id and password. If a user has their site setup with 2-factor authentication, login requires them entering a code they receive on their cell.

Even if you used a generic Google docs account of your own, you would still have to grant permission to each user to view their spreadsheet.

You could try the Formidable Zapier add-on. Zapier has a Google Sheets connector that may work to create the spreadsheet. I don't know about the sharing part though. https://zapier.com/apps/google-sheets/integrations/

Discussion closed.