--- title: "Create Rows" url: https://docs.catalyst.zoho.com/en/sdk/ios/v2/cloud-scale/data-store/create-rows/ description: "You can create a single row or multiple rows in a data store table." last_updated: 2025-11-19T15:07:41Z service: Cloud Scale type: general related_links: - name: "Data Store" url: /en/cloud-scale/help/data-store/introduction - name: "Records" url: /en/cloud-scale/help/data-store/records - name: "Insert Row - API" url: /en/api/code-reference/cloud-scale/data-store/insert-new-row/#InsertNewRow --- # Create Rows ### Create a Single Row You can create a new row in a [Data Store](https://docs.catalyst.zoho.com/en/cloud-scale/help/data-store/introduction) table of the given instance using the `newRow()` method, as shown below. You must set the values of the rows in the table, by specifying the column name and the corresponding row value as a key-value pair. The `<ROW_INSTANCE>` used in the code syntax below is the instance defined in the [Row Instance page](https://docs.catalyst.zoho.com/en/sdk/ios/v2/cloud-scale/data-store/create-new-row-instance). The column value is set using the method discussed in the [Add a Column Value page](https://docs.catalyst.zoho.com/en/sdk/ios/v2/cloud-scale/data-store/add-column-value-to-row). **Parameters**: * `completion`: If the operation is successful, the completion block will return the details of the created row, such as its unique ROWID and other meta information. Else, it will return an error. > **Note:** If a column was created with the `is_unique` or `is_mandatory` property enabled, you must ensure that the value is unique or is mandatorily passed, respectively. You must also ensure that the data you pass for a column is of the column's configured data type. A sample code snippet is shown below: ```bash let instance = ZCatalystApp.shared.getDataStoreInstance(tableIdentifier: "1096000000002071").newRow() //Replace this with your Table ID instance.setColumnValue(columnName: "Department_Name", value: "Marketing") instance.setColumnValue(columnName: "Employee_Name", value: "Linda Page") //Replace this with your column name and value instance.create() {(result) in switch result{ case .success ( let row) : print("A new row is successfully created with row id /(row.id)") case .error( let error ) : print( "Error occurred >>> \( error )" ) } } ``` ### Create Multiple Rows iOS SDK enables you to create multiple rows in a table of the given instance at a time. This is done by passing an array containing the rows that need to be inserted in the table. The array is passed as an argument to the `create()` method, as shown in the code structure below. You must pass the array of `<ROW_INSTANCE>`, after creating the instance for each row as explained in the [Row Instance page](https://docs.catalyst.zoho.com/en/sdk/ios/v2/cloud-scale/data-store/create-new-row-instance). Their column value must be set as discussed in the [Add a Column Value page](https://docs.catalyst.zoho.com/en/sdk/ios/v2/cloud-scale/data-store/add-column-value-to-row). The `<DATA_STORE_INSTANCE>` used in the code below is the instance created earlier in the [Data Store Instance page](https://docs.catalyst.zoho.com/en/sdk/ios/v2/cloud-scale/data-store/create-data-store-instance/). ```bash <DATA_STORE_INSTANCE>.create(_ rows: [ ZCatalystRow ], completion: @escaping(Result<[ZCatalystRow], ZCatalystError>) -> Void) ``` **Parameters**: * `rows`: The array of rows to be created. * `completion`: If the operation is successful, the completion block returns the details of the rows created, such as their ROWIDs and other meta information. Else, it returns an error. A sample code snippet is shown below: ```bash let row_instance1 = ZCatalystApp.shared.getDataStoreInstance(tableIdentifier: "1096000000002071").newRow() //replace your table id here row_instance1.setColumnValue(columnName: "Department_Name", value: "Marketing") row_instance1.setColumnValue(columnName: "Employee_Name", value: "Robert Jones") //Replace this with your column name and value let row_instance2 = ZCatalystApp.shared.getDataStoreInstance(tableIdentifier: "1096000000002071").newRow() //Replace this with your Table ID row_instance2.setColumnValue(columnName: "Department_Name", value: "Finance") row_instance2.setColumnValue(columnName: "Employee_Name", value: "Louis Smith") //Replace this with your column name and value ZCatalystApp.shared.getDataStoreInstance(tableIdentifier: "1096000000002071").create([row_instance1, row_instance2]) {(result) in switch result{ case .success ( let rows) : print("The rows ids which are successfully created are listed below") for row in rows{ print(row.id) } case .error( let error ) : print( "Error occurred >>> \( error )" ) } } ```