{"action":"created","issue":{"url":"https://api.github.com/repos/codeforamerica/typeseam/issues/11","labels_url":"https://api.github.com/repos/codeforamerica/typeseam/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/codeforamerica/typeseam/issues/11/comments","events_url":"https://api.github.com/repos/codeforamerica/typeseam/issues/11/events","html_url":"https://github.com/codeforamerica/typeseam/issues/11","id":124089794,"number":11,"title":"How to deal with checkboxes","user":{"login":"daguar","id":994938,"avatar_url":"https://avatars.githubusercontent.com/u/994938?v=3","gravatar_id":"","url":"https://api.github.com/users/daguar","html_url":"https://github.com/daguar","followers_url":"https://api.github.com/users/daguar/followers","following_url":"https://api.github.com/users/daguar/following{/other_user}","gists_url":"https://api.github.com/users/daguar/gists{/gist_id}","starred_url":"https://api.github.com/users/daguar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daguar/subscriptions","organizations_url":"https://api.github.com/users/daguar/orgs","repos_url":"https://api.github.com/users/daguar/repos","events_url":"https://api.github.com/users/daguar/events{/privacy}","received_events_url":"https://api.github.com/users/daguar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/codeforamerica/typeseam/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/codeforamerica/typeseam/milestones/3","html_url":"https://github.com/codeforamerica/typeseam/milestones/v0.03","labels_url":"https://api.github.com/repos/codeforamerica/typeseam/milestones/3/labels","id":1476121,"number":3,"title":"v0.03","description":"An improved Beta, with faster transformation of pdf forms.","creator":{"login":"bengolder","id":451510,"avatar_url":"https://avatars.githubusercontent.com/u/451510?v=3","gravatar_id":"","url":"https://api.github.com/users/bengolder","html_url":"https://github.com/bengolder","followers_url":"https://api.github.com/users/bengolder/followers","following_url":"https://api.github.com/users/bengolder/following{/other_user}","gists_url":"https://api.github.com/users/bengolder/gists{/gist_id}","starred_url":"https://api.github.com/users/bengolder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengolder/subscriptions","organizations_url":"https://api.github.com/users/bengolder/orgs","repos_url":"https://api.github.com/users/bengolder/repos","events_url":"https://api.github.com/users/bengolder/events{/privacy}","received_events_url":"https://api.github.com/users/bengolder/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-12-28T17:14:47Z","updated_at":"2015-12-28T17:15:00Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-12-28T16:45:33Z","updated_at":"2016-01-10T22:27:43Z","closed_at":null,"body":"I've been thinking about this so figured I'd open an issue for discussion.\r\n\r\nThere seem to be two types of checkboxes:\r\n1. One where \"yes/no\" maps cleanly to a **single checkbox** being checked or not\r\n2. One where \"yes/no\" maps to **checking one of two possible checkboxes**\r\n\r\nThe (1) case is fairly straightforward, but (2) is trickier.\r\n\r\nTo deal with this, one might \r\n\r\nI've also been thinking that more generally a user could always have access to a lambda/closure that has (a) all inputs and (b) PDF fields available to allow for custom field hackery.\r\n\r\nFor illustration, here's an example:\r\n```python\r\ndef additional_custom_writing_for_pdf_after_initial_population(input_data_dict, pdf_fields_with_initial_values_dict):\r\n    if input_data_dict['user_said_to_mark_all_checkbox_questions_yes']:\r\n        pdf_field_with_initial_values_dict['Checkbox 1'] = 'yes'\r\n        pdf_field_with_initial_values_dict['Checkbox 2'] = 'yes'\r\n        pdf_field_with_initial_values_dict['Checkbox 3'] = 'yes'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/codeforamerica/typeseam/issues/comments/170399756","html_url":"https://github.com/codeforamerica/typeseam/issues/11#issuecomment-170399756","issue_url":"https://api.github.com/repos/codeforamerica/typeseam/issues/11","id":170399756,"user":{"login":"bengolder","id":451510,"avatar_url":"https://avatars.githubusercontent.com/u/451510?v=3","gravatar_id":"","url":"https://api.github.com/users/bengolder","html_url":"https://github.com/bengolder","followers_url":"https://api.github.com/users/bengolder/followers","following_url":"https://api.github.com/users/bengolder/following{/other_user}","gists_url":"https://api.github.com/users/bengolder/gists{/gist_id}","starred_url":"https://api.github.com/users/bengolder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengolder/subscriptions","organizations_url":"https://api.github.com/users/bengolder/orgs","repos_url":"https://api.github.com/users/bengolder/repos","events_url":"https://api.github.com/users/bengolder/events{/privacy}","received_events_url":"https://api.github.com/users/bengolder/received_events","type":"User","site_admin":false},"created_at":"2016-01-10T22:27:43Z","updated_at":"2016-01-10T22:27:43Z","body":"@daguar I like your proposal. I think a nice internal hook for custom post transformation is a great idea. In the Typeform to Seamless docs code, I created a [field translation object](https://github.com/codeforamerica/typeseam/blob/master/data/translator.py) with [associated processors](https://github.com/codeforamerica/typeseam/blob/master/typeseam/form_filler/form_field_processors.py), a similar but not as versatile method.\r\n\r\nFor this particular case of dealing with different checkboxes, it also seems possible that an API consumer could POST JSON data that names multiple fields as mutually exclusive.\r\n```\r\n\"radio_fields\": [\r\n    \"Checkbox 1\",\r\n    \"Checkbox 2\",\r\n    \"Checkbox 3\",\r\n]\r\n```"}}