# \_edit

Creates a new Asset Table, or edits properties of an existing Asset Table

### Parameters

#### id

The ID of the Asset Table being created/modified

#### name

The name of the Asset Table

#### fields

An Array which contains all fields within the Asset Table, each field has 3 variables:\
id\
name\
type (Can be one of 3: text, textarea, datetime)

### Example

```
FM_api('AssetTable_edit',[
  'id'=>'1689671250273',
  'name'=>'New Table',
  'fields'=>'[
    {
      "id":"1",
      "name":"Test Field Success",
      "type":"text"
    },
    {
      "id":"2",
      "name":"Test2",
      "type":"textarea"
    },
    {
    "id":"3",
    "name":"Occurrence",
    "type":"datetime"
    }
   ]'
  ]
);
```

### Results

#### On Success

```
{"ok":1}
```

#### On Failure

If the "id" parameter is not included or has a value less than 1:

```
{"error":"missing or invalid parameter: id"}
```

If the "name" parameter is not included or has an empty value when trimmed:

```
{"error":"missing or invalid parameter: name"}
```

If the "fields" parameter is not included:

```
{"error":"missing parameter: fields"}
```

If the "fields" value is in an invalid format (e.g a missing bracket or the value is not an array)

```
{"error":"invalid parameter: fields"}
```


---

# 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/assettable/_edit.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.
