Several people have asked for enhancements, many of which are similar. The most common request is to add either pre-filled or hidden fields based on something WordPress knows about. A recent request was to add tracking so a form could only be submitted by a user once. I am certainly not opposed to adding features like these, I think most would be pretty useful. However, there are some things to think about before implementing a solution or adding new features.
- To auto-fill a field or populate a hidden field, the field must be mapped from what the column is called on the Google Docs side of the form to something WordPress knows about (e.g. username, email address, etc.). How should this mapping be done? Arguments as part of the shortcode? For anything to be posted to the form processor on the Google side, the field must be defined on the form so the results spreadsheet has a corresponding column. For hidden fields, wpGForm would have to turn what is an existing field (which may or may not be a simple text box) into a hidden field with a value supplied by WordPress. This isn’t impossible, jQuery can do much of the work fairly easily but the problem is it is fraught with potential errors so I am reluctant to add it until I have a better idea how to bullet proof it. Pre-populating values is fairly easy, as long as we know what the field name
- I’ve considered, and posted about, introducing a Custom Post Type for forms. If I do this, then it makes addressing the tracking aspect fairly easy because the CPT id could be stored as part of the users meta data. That is pretty straight forward once the CPT exists (which it doesn’t yet). However, it does require the user to be logged into the site which many people don’t want to allow. This could also be handled by the CPT which could in theory, define a new form as anonymous or not. An anonymous form would have some limitations, tracking being one of them.
I’ve got some ideas on how to implement these features, most of which would be pretty useful. Introducing a CPT is absolutely on my radar screen but right now I am focused on my Swim Team plugin as we’re gearing up for Summer Swim Season here in North Carolina. Once I knock out my to-do list on the Swim Team plugin I’ll come back and look at adding the CPT for WordPress Google Forms which would facilitate adding some of the requests people have asked for.
Really interested in seeing where you go with this – do you have a GIT fork for this?
I don’t have it on GitHub. I took over development of this plugin from the original author a few years ago and just left it in Subversion. I’ve started using Git for some of my more recent stuff but haven’t found a reason to move development of Email Users to Git yet.
Hi Mike, did the first part of the post get implemented?
I’ve been using Google Forms for several years on my site and I’m trying to negate the need for a user to complete their name and email address on a form on my website.
I’ve recently started testing publishing my site with WordPress.
Swapping in the site username would make this perfect. Any assistance on this would be great.
Have you looked at the Hidden Fields functionality? If you require your users to be logged in then hidden fields can take on the email or username of the user currently logged in and submitting the form. The hidden fields can be mapped to a column on the spreadsheet.
Thanks Mike. I’ve had a look at that, but not sure how it is implemented. I’ve sent you over the details of where it will be used if you wouldn’t mind giving me a few pointers?
Where did you send the details to? I don’t have anything in my email. In the meantime, here is a post about Hidden Fields from when I first announced it.
Thanks Mike.
I understand now!