{"_id":"5536e6ed9f7f2d0d00b1cd56","__v":13,"category":{"_id":"5536e6bf7fe60f0d000fd1c0","__v":18,"pages":["5536e6ed9f7f2d0d00b1cd56","5536e736bbb4a70d00a53534","5536e73f9f7f2d0d00b1cd59","5536e74dbbb4a70d00a53536","5536e7569f7f2d0d00b1cd5b","5536e7609f7f2d0d00b1cd5d","5536e76b20d5ca0d0001580d","5536e78220d5ca0d0001580f","5536e797b91d030d004c3d91","5536e7a120d5ca0d00015811","5536e7b320d5ca0d00015813","5536e7bbbbb4a70d00a5353a","5536e7c99f7f2d0d00b1cd60","5536e7d29030530d0007f860","5536e7dbbbb4a70d00a5353c","5536e7e69f7f2d0d00b1cd62","5571ef581cd8283500a8b4de","55b80d6be89bbf25009f045b"],"project":"55357364e02d480d0003c6d3","version":"553591cd63cc650d00312925","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-22T00:09:35.017Z","from_sync":false,"order":9,"slug":"form-fields","title":"Form Fields"},"version":{"_id":"553591cd63cc650d00312925","project":"55357364e02d480d0003c6d3","__v":13,"forked_from":"55357365e02d480d0003c6d6","createdAt":"2015-04-20T23:54:53.134Z","releaseDate":"2015-04-20T23:54:53.134Z","categories":["553591cd63cc650d00312926","553591cd63cc650d00312927","5536e4d39f7f2d0d00b1cd54","5536e55c20d5ca0d0001580a","5536e6bf7fe60f0d000fd1c0","5536f5bba171250d00c00556","553a974369c2630d00a8562e","553a97c60074c80d00621c2a","553a98332af5f20d000fc32a","553a9b9869c2630d00a85642","556e0f23d02e0b190042f13d","563249b1dcc27a1700823650","5639113f049e420d00476b03","59a5dd94aaa11d003334edb4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"project":"55357364e02d480d0003c6d3","user":"55356ede6040a20d00454508","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-22T00:10:21.496Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Every form has a collection of `fields`.  Fields can be of different types; some simple such as a text field, and some more complex such as a signature field or image field.  The definition of a field is defined on the Template for which the form is an instance of.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Field Types\"\n}\n[/block]\nThe `fields` collection on a form can be one of the following fields:\n- [Text Field](doc:text-field) \n- [Signature Field](doc:signature-field) \n- [Image Field](doc:image-field) \n- [Sketch Field](doc:sketch-field) \n- [Gps Field](doc:gps-field) \n- [Date Field](doc:date-field) \n- [Time Field](doc:time-field) \n- [DateTime Field](doc:datetime-field) \n- [Table Field](doc:table-field) \n- [DropDown Field](doc:dropdown-field) \n- [AutoNumber Field](doc:autonumber-field) \n- [Number Field](doc:number-field) \n- [CheckBox Field](doc:checkbox-field) \n- [CheckBoxGroup Field](doc:checkboxgroup-field) \n- [Database Field](doc:database-field) \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Referencing a Field\"\n}\n[/block]\nForm `fields` can be referenced by an Id or a name.  If a template has a text field named \"City\", for example, retrieving a form based on this template would return the field in the following way:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n\\t\\\"fields\\\":  {\\n  \\t\\\"City\\\": {\\n      \\\"text\\\": \\\"San Diego\\\",\\n      \\\"id\\\": \\\"28b3af03-6ae2-4a1c-9b01-a46c0108d3c5\\\",\\n      \\\"name\\\": \\\"City\\\",\\n      \\\"type\\\": \\\"TextBox\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"The id, name, and type are not necessary when creating or updating a form, they are returned in the `JSON` of a request for readability.\",\n  \"title\": \"Note:\"\n}\n[/block]\nIn order to assign the field an initial value or to update the value of this field you only need to specify the `\"name\"` or the `\"id\"` of the field plus the value for that specific field.  The following example details setting the value of the text field using the field `\"name\"` and the `\"id\"`:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// by name...\\n{\\n\\t\\\"fields\\\":  {\\n  \\t\\\"City\\\": {\\n      \\\"text\\\": \\\"Las Vegas\\\",\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// by id...\\n{\\n\\t\\\"fields\\\":  {\\n  \\t\\\"28b3af03-6ae2-4a1c-9b01-a46c0108d3c5\\\": {\\n      \\\"text\\\": \\\"Las Vegas\\\",\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"form-field-reference","type":"basic","title":"Form Field Reference"}

Form Field Reference


Every form has a collection of `fields`. Fields can be of different types; some simple such as a text field, and some more complex such as a signature field or image field. The definition of a field is defined on the Template for which the form is an instance of. [block:api-header] { "type": "basic", "title": "Field Types" } [/block] The `fields` collection on a form can be one of the following fields: - [Text Field](doc:text-field) - [Signature Field](doc:signature-field) - [Image Field](doc:image-field) - [Sketch Field](doc:sketch-field) - [Gps Field](doc:gps-field) - [Date Field](doc:date-field) - [Time Field](doc:time-field) - [DateTime Field](doc:datetime-field) - [Table Field](doc:table-field) - [DropDown Field](doc:dropdown-field) - [AutoNumber Field](doc:autonumber-field) - [Number Field](doc:number-field) - [CheckBox Field](doc:checkbox-field) - [CheckBoxGroup Field](doc:checkboxgroup-field) - [Database Field](doc:database-field) [block:api-header] { "type": "basic", "title": "Referencing a Field" } [/block] Form `fields` can be referenced by an Id or a name. If a template has a text field named "City", for example, retrieving a form based on this template would return the field in the following way: [block:code] { "codes": [ { "code": "{\n\t\"fields\": {\n \t\"City\": {\n \"text\": \"San Diego\",\n \"id\": \"28b3af03-6ae2-4a1c-9b01-a46c0108d3c5\",\n \"name\": \"City\",\n \"type\": \"TextBox\"\n }\n }\n}", "language": "json" } ] } [/block] [block:callout] { "type": "info", "body": "The id, name, and type are not necessary when creating or updating a form, they are returned in the `JSON` of a request for readability.", "title": "Note:" } [/block] In order to assign the field an initial value or to update the value of this field you only need to specify the `"name"` or the `"id"` of the field plus the value for that specific field. The following example details setting the value of the text field using the field `"name"` and the `"id"`: [block:code] { "codes": [ { "code": "// by name...\n{\n\t\"fields\": {\n \t\"City\": {\n \"text\": \"Las Vegas\",\n }\n }\n}", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "// by id...\n{\n\t\"fields\": {\n \t\"28b3af03-6ae2-4a1c-9b01-a46c0108d3c5\": {\n \"text\": \"Las Vegas\",\n }\n }\n}", "language": "json" } ] } [/block]