# \_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"}
```
