{"_id":"5536e7a120d5ca0d00015811","user":"55356ede6040a20d00454508","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","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"},"__v":10,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-22T00:13:21.327Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":9,"body":"The Table Field is the only field type which can contain other fields.  \n\nTable Fields have a property named `rows`, which represent a collection of `row` objects.  Each `row` object has a `columns` property which contain a collection of `fields` that represent the columns of that row.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"My Sample Table\\\": {\\n      \\\"rows\\\": {\\n        \\\"0\\\": {\\n          \\\"columns\\\": {\\n            \\\"Column 1\\\": {\\n              \\\"text\\\": \\\"this is some text\\\",\\n              \\\"id\\\": \\\"99ce5621-d5a3-461e-bb58-a47901106271\\\",\\n              \\\"name\\\": \\\"Column 1_0\\\",\\n              \\\"type\\\": \\\"TextBox\\\"\\n            },\\n            \\\"Column 2\\\": {\\n              \\\"value\\\": \\\"2015-04-15T09:32:00.0000000+00:00\\\",\\n              \\\"displayValue\\\": \\\"4/15/2015 9:32 AM\\\",\\n              \\\"id\\\": \\\"acac9894-8178-4ef1-af3f-a47901106271\\\",\\n              \\\"name\\\": \\\"Column 2_0\\\",\\n              \\\"type\\\": \\\"DateTime\\\"\\n            }\\n          }\\n        },\\n        \\\"1\\\": {\\n          \\\"columns\\\": {\\n            \\\"Column 1\\\": {\\n              \\\"text\\\": \\\"this is also a text field\\\",\\n              \\\"id\\\": \\\"99ce5621-d5a3-461e-bb58-a47901106271\\\",\\n              \\\"name\\\": \\\"Column 1_1\\\",\\n              \\\"type\\\": \\\"TextBox\\\"\\n            },\\n            \\\"Column 2\\\": {\\n              \\\"value\\\": \\\"2015-04-26T09:32:00.0000000+00:00\\\",\\n              \\\"displayValue\\\": \\\"4/26/2015 9:32 AM\\\",\\n              \\\"id\\\": \\\"acac9894-8178-4ef1-af3f-a47901106271\\\",\\n              \\\"name\\\": \\\"Column 2_1\\\",\\n              \\\"type\\\": \\\"DateTime\\\"\\n            },\\n            \\\"Column 3\\\": {\\n              \\\"text\\\": \\\"jk\\\",\\n              \\\"id\\\": \\\"65ea5872-7d05-4e1e-a62c-a47901106271\\\",\\n              \\\"name\\\": \\\"Column 3_1\\\",\\n              \\\"type\\\": \\\"TextBox\\\"\\n            }\\n          }\\n        },\\n        \\\"3\\\": {\\n          \\\"columns\\\": {\\n            \\\"Column 2\\\": {\\n              \\\"value\\\": \\\"2015-04-02T09:32:00.0000000+00:00\\\",\\n              \\\"displayValue\\\": \\\"4/2/2015 9:32 AM\\\",\\n              \\\"id\\\": \\\"acac9894-8178-4ef1-af3f-a47901106271\\\",\\n              \\\"name\\\": \\\"Column 2_3\\\",\\n              \\\"type\\\": \\\"DateTime\\\"\\n            }\\n          }\\n        }\\n      },\\n      \\\"rowCount\\\": 4,\\n      \\\"columnCount\\\": 3,\\n      \\\"id\\\": \\\"e411a90f-ad49-4927-9b3b-a47901106271\\\",\\n      \\\"name\\\": \\\"My Sample Table\\\",\\n      \\\"type\\\": \\\"Table\\\"\\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 setting or updating the Table Field and related Child Fields. These properties are returned in the JSON of the request for readability.\",\n  \"title\": \"NOTE:\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Table Operations\"\n}\n[/block]\n**Changing a Field Value** \n\nIn general, the Table Field has no properties which can be set or updated.  Instead, updates will be performed on the actual fields that the Table Field contains.  \n\nTo update a Field within a Table Field only the information relevant to the update are required.  Namely, the row, the column, and the new value for the field that will be updated.\n\nAs an example, updating a Text Field contained in the 2nd row of the 3rd column of a Table Field would like:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"My Sample Table\\\": {\\n  \\\"rows\\\": {\\n    \\\"1\\\": {\\n      \\\"columns\\\": {\\n        \\\"2\\\": {\\n          \\\"text\\\": \\\"Update this field only!\\\",\\n          \\\"id\\\": \\\"99ce5621-d5a3-461e-bb58-a47901106271\\\",\\n          \\\"name\\\": \\\"Column 1_2\\\",\\n          \\\"type\\\": \\\"TextBox\\\"\\n        }\\n      }\\n    }\\n  }\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"NOTE:\",\n  \"body\": \"Even if a table has multiple rows or columns the GoFormz API will only update the values specified.  All other fields will remain the same.\"\n}\n[/block]\n**Clearing a Field** \n\nTo clear a column Field simply set the value of the column to `NULL`.  The only relevant information to include to clear a value is the row number and the column number.  \n\nThe following example demonstrates how to clear the value of a Text Field contained in the 2nd row of the 3rd column of a Table Field:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"My Sample Table\\\": {\\n  \\\"rows\\\": {\\n    \\\"1\\\": {\\n      \\\"columns\\\": {\\n        \\\"2\\\": NULL\\n      }\\n    }\\n  }\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n**Clearing an entire row** \n\nTo clear an entire row of columns within a Table Field simply set the specific row value to `NULL`.  The only relevant information to include to clear a row of columns is the row number to clear.\n\nThe following example demonstrates how to clear the columns contained in the 2nd row of a Table Field:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"My Sample Table\\\": {\\n  \\\"rows\\\": {\\n    \\\"1\\\": NULL\\n    }\\n  }\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"table-field","type":"basic","title":"Table Field"}
The Table Field is the only field type which can contain other fields. Table Fields have a property named `rows`, which represent a collection of `row` objects. Each `row` object has a `columns` property which contain a collection of `fields` that represent the columns of that row. [block:code] { "codes": [ { "code": "\"My Sample Table\": {\n \"rows\": {\n \"0\": {\n \"columns\": {\n \"Column 1\": {\n \"text\": \"this is some text\",\n \"id\": \"99ce5621-d5a3-461e-bb58-a47901106271\",\n \"name\": \"Column 1_0\",\n \"type\": \"TextBox\"\n },\n \"Column 2\": {\n \"value\": \"2015-04-15T09:32:00.0000000+00:00\",\n \"displayValue\": \"4/15/2015 9:32 AM\",\n \"id\": \"acac9894-8178-4ef1-af3f-a47901106271\",\n \"name\": \"Column 2_0\",\n \"type\": \"DateTime\"\n }\n }\n },\n \"1\": {\n \"columns\": {\n \"Column 1\": {\n \"text\": \"this is also a text field\",\n \"id\": \"99ce5621-d5a3-461e-bb58-a47901106271\",\n \"name\": \"Column 1_1\",\n \"type\": \"TextBox\"\n },\n \"Column 2\": {\n \"value\": \"2015-04-26T09:32:00.0000000+00:00\",\n \"displayValue\": \"4/26/2015 9:32 AM\",\n \"id\": \"acac9894-8178-4ef1-af3f-a47901106271\",\n \"name\": \"Column 2_1\",\n \"type\": \"DateTime\"\n },\n \"Column 3\": {\n \"text\": \"jk\",\n \"id\": \"65ea5872-7d05-4e1e-a62c-a47901106271\",\n \"name\": \"Column 3_1\",\n \"type\": \"TextBox\"\n }\n }\n },\n \"3\": {\n \"columns\": {\n \"Column 2\": {\n \"value\": \"2015-04-02T09:32:00.0000000+00:00\",\n \"displayValue\": \"4/2/2015 9:32 AM\",\n \"id\": \"acac9894-8178-4ef1-af3f-a47901106271\",\n \"name\": \"Column 2_3\",\n \"type\": \"DateTime\"\n }\n }\n }\n },\n \"rowCount\": 4,\n \"columnCount\": 3,\n \"id\": \"e411a90f-ad49-4927-9b3b-a47901106271\",\n \"name\": \"My Sample Table\",\n \"type\": \"Table\"\n }\n }\n", "language": "json" } ] } [/block] [block:callout] { "type": "info", "body": "The id, name, and type are not necessary when setting or updating the Table Field and related Child Fields. These properties are returned in the JSON of the request for readability.", "title": "NOTE:" } [/block] [block:api-header] { "type": "basic", "title": "Table Operations" } [/block] **Changing a Field Value** In general, the Table Field has no properties which can be set or updated. Instead, updates will be performed on the actual fields that the Table Field contains. To update a Field within a Table Field only the information relevant to the update are required. Namely, the row, the column, and the new value for the field that will be updated. As an example, updating a Text Field contained in the 2nd row of the 3rd column of a Table Field would like: [block:code] { "codes": [ { "code": "\"My Sample Table\": {\n \"rows\": {\n \"1\": {\n \"columns\": {\n \"2\": {\n \"text\": \"Update this field only!\",\n \"id\": \"99ce5621-d5a3-461e-bb58-a47901106271\",\n \"name\": \"Column 1_2\",\n \"type\": \"TextBox\"\n }\n }\n }\n }", "language": "json" } ] } [/block] [block:callout] { "type": "info", "title": "NOTE:", "body": "Even if a table has multiple rows or columns the GoFormz API will only update the values specified. All other fields will remain the same." } [/block] **Clearing a Field** To clear a column Field simply set the value of the column to `NULL`. The only relevant information to include to clear a value is the row number and the column number. The following example demonstrates how to clear the value of a Text Field contained in the 2nd row of the 3rd column of a Table Field: [block:code] { "codes": [ { "code": "\"My Sample Table\": {\n \"rows\": {\n \"1\": {\n \"columns\": {\n \"2\": NULL\n }\n }\n }", "language": "json" } ] } [/block] **Clearing an entire row** To clear an entire row of columns within a Table Field simply set the specific row value to `NULL`. The only relevant information to include to clear a row of columns is the row number to clear. The following example demonstrates how to clear the columns contained in the 2nd row of a Table Field: [block:code] { "codes": [ { "code": "\"My Sample Table\": {\n \"rows\": {\n \"1\": NULL\n }\n }", "language": "json" } ] } [/block]