3

I’m wondering if there is a way to set up data validation at the data entry level or restrict the entry to a choice set in CartoDB.

Scenario: I want to display categorical data in a Visualization and continually update the database/Table. So… I add a point to my dataset/Table. Then, I click on it and edit the data. I now want to enter values for the various attributes for that point.

The problem: I can do it, but I don’t have any validation feature to restrict what I enter (other than if the attribute is set as “number”, “boolean", or “date”). I want to limit what I can enter to a choice set (e.g., like in with drop-down menu). If I could have the world, so to speak, I would love to have a survey form type of data entry feature – complete with “multiple choice”, “select all that apply”, formatting checks, and maybe even logic.

Question 1: Is this possible with CartoDB?

Question 2: Is there a way I could set this up, e.g., with embedding a survey form in the map pop-up window? I want the data to go straight into the CartoDB dataset/table that drives my Visualizations. I suppose I may be able to do this directly using a survey and have CartoDB reference or sync with that dataset/Table… but I want to be able to manually locate/pin the point on a map (to get Lat/Lon), and I don’t know of a survey platform that is capable of doing this.

2

If I understand your question you definitely can do this via CartoDB.js which is the library that the CartoDB service uses. Specifically for the infowindows interactivity you need, you'd first have to create a map with CartoDB.js and the set up your custom interactivity for the infowindows in order to validate and format the data inside the infowindow.

In the case you would only need to embed a survey with no interaction, you can work with html templates via the CartoDB UI.

  • All this is covered in the documentation and the tutorial examples. – matallo Dec 11 '13 at 14:56
  • Thank you for the answer. That is helpful (although I have some learning and customization to do I suppose). – Dave Jun 3 '14 at 22:44
2

Another complement to this answer.

If you actual schema validation at the database level, then you have all the power of PostgreSQL, with range types and constraints.

Check out http://www.postgresql.org/docs/9.4/static/ddl-constraints.html

This will ensure that the data you enter gets validated at the database level.

This can be very handy on complex applications.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.