We Are Here To Help

Follow

Create a form to gather input from visitors

One of the great ways you can use your Socrata-powered data site is to gather input from your constituents using Socrata Forms. By creating a form, you can allow members of the public to submit entries to a dataset using a publicly-accessible form. Your form can even submit to a private dataset so that can you can review submissions without making them public.

To create a form, you should first start with a dataset that you want your entries to be submitted to. You can either design a dataset from scratch by adding your own columns, or you can base it off a dataset that you imported from an uploaded file. The columns in your dataset will be mapped to the form fields in the form that will be created, so make sure you have the right set of columns set up before you create your form.

Once you've got your dataset ready, you can create your form.

 

CREATING A FORM

Logged in as the dataset owner, click on "Embed" and then "Form".

 form.png

 

You'll be presented with a few fields to fill out:

  1. "Name": The name that will be used for your form. The form itself functions like a filtered view or visualization, so it'll be shown in your profile page and data catalog.
  2. "Success URL": This is an optional URL you can specify that visitors will be redirected to after they fill out your form. You can use this to provide a "Thank You" page that they'll be sent to after they've submitted their response.
  3. "Public": By default, your form will be public. This means that anybody can submit to your form. If you make it private, you'll need to explicitly share your form with others using the sharing tool in order for them to submit to it.

Then click "Create" to create your form, and your browser will reload to display the new form that has been created -

form-view.png

 

EMBEDDING YOUR FORM

If you click on the "Embed" sidebar again, you'll see you've been provided two different embedding options:

form-embed.png

  1. "Embed this Form as Plain HTML": This allows you to embed the form as raw HTML into your webpage. This gives you the greatest control over the layout of the form, since you can remove form fields and control how it is styled using CSS. However, if you later go change the fields in your form by changing the names or order of your columns, they will not automatically be reflected in the form, and you'll need to update your form code each time.
  2. "Embed this Dataset in a Frame": This allows you to embed the form inside an iFrame, much like the Socrata Data Player. Since the form is embedded in an iFrame, it will automatically update when you modify the columns in your dataset. However, you can't control the styling of the form using CSS.

You are also given the regular customization options as with any embedded view on the Socrata Platform, which are given right below the embedding options:

form-embed-customizations.png

  1. "Size" - Select from 3 preset embed options
  2. "Custom Size" - You can also enter in custom dimensions
  3. "Social Data Player Template" - Select the embed framing style from a drop-down menu (these are determined by the site admins and designers)

 

Once you've embedded your form, test it once or twice to make sure it works on your website or blog. Then you're good to go!

Here is an example of a form embedded on a website -

Plain HTML

form-html.png

 

Frame

form-frame.png

Adding checkbox or dropdowns

If you go the dataset that powers the form and click on the red + sign to add a new column, you will have a Column Type section with a drop down called "Data Type" in the yellow edit panel. Select the "Multiple Choice" option in the dropdown to populate this drop down field. 

 
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

  • Avatar
    Mathias Gibson

    Is there a way to make fields required?  Also, does the time have to be manually entered, or can the form add a time stamp for each submission?

  • Avatar
    Unknown

    Was this question ever answered?  I also would like to know if Form fields can be required before a submission will be accepted.   Thank you.

  • Avatar
    Kellie Fontes

    Hi Jeff!

    This question was resolved within a ticket Mathias left - currently the author of the article is the only one who receives a notification if someone comments and I only saw this after updating the documentation.

    We DO support automatic time entry! The default time if not entered manually by the user will display the time the form was submitted in UTC ( Coordinated Universal Time).

    We don't support the functionality of mandatory fields at this time, however. We can consider this as a feature request. The standard process for those is for our users to submit the feature request to http://support.socrata.com/forums/84703-Feature-Requests where we triage them and make decisions about rollout and timing based on the needs of our customer base. Currently there has not been a request created in the forum so I created the request just now -

    Feature Request link for required fields: http://support.socrata.com/entries/32685248-Form-feature-entry-required-fields. I recommend that all interested in updates subscribe to the post to receive notifications.

     

  • Avatar
    Unknown

    Thanks Kellie – your response time is always stellar.    

    Regarding time entry, I am interested in creating a “time stamp” column that records the time of form submission/data entry.   Preferably, it would be hidden from view and would happen behind the scenes.

    Let me know and I can make this a feature request. 

    Again, I appreciate your help. 

     

  • Avatar
    Kellie Fontes

    Thanks for the note Jeff :)

    It is currently not possible to have a separate column for time entry so if you could create a feature request for it that would be great!

    I explored a workaround in the meantime to see if this was possible and found another piece of information which may be helpful.

    I created a view with a hidden time column and created a form off of this view. The idea was that since entries through a form propagate down to the original underlying dataset, when a user hits submit the underlying dataset will have that date/time column populated. If this underlying dataset is private then this could have been a behind-the-scenes solution. However, I found that one CANNOT submit form entries to a view which contains hidden columns - an error message is returned.

  • Avatar
    Unknown

    Kellie, thanks for the reply and the attempted timestamp workaround.   I did some experimenting on my end as well and discovered that exporting the data to RSS is one way of capturing when a row was updated.   It appears the pubdate value in the RSS xml corresponds to when the row was updated (or, it's at least close!).   

     

  • Avatar
    Kellie Fontes

    Sweet! That was one option I didn't think of - great idea and thanks for sharing! :)

  • Avatar
    Chris Kershaw

    Can the form, upon submission, also generate an email with the results?

  • Avatar
    Kellie Fontes

    Hi Chris!

    If you were to subscribe to the underlying dataset the form feeds into, you would be notified of every new submission to the form. You can subscribe by clicking on the 'Subscribe via Email or RSS' button and checking the option to receive email notifications (http://support.socrata.com/entries/39799596-Social-media-configurations).

     

  • Avatar
    Dave Ballinger

    Is it possible to make the actual form private so that only select persons can fill it out and populate a dataset?

  • Avatar
    Dave Ballinger

    I should fine tune my request: Does the person you share a form with need to have a socrata account set up?

Powered by Zendesk