# \_setRow

Adds data to an array of table cells

### Parameters

#### cid

Customer ID

#### tid

Table ID

#### id

Row ID. Leave as 0 to add a new row. Otherwise use the ID of the row.

#### row

JSON-encoded hash-array of data. The indexes of the items are the column IDs.

### Example

```
FM_api('CustomerTable_setRow',['id'=>'0','cid'=>'502772','tid'=>'1580830943940','row'=>'{"1":"1","2":"4","3":"3","31":"2","32":"5"}']);
```

This example shows the addition of a row to table 1580830943940 for customer 502772. The columns amended have IDs 1, 2, 3, 31, 32.

#### On Success

```
{'ok':"91001"}
```

The ID of the created or edited row will be returned on success.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/customertable/_setrow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
