> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/jobtype/_setform.md).

# \_setForm

Sets the default Form of a Job Type

### Parameters

#### id

The ID of the Job Type.

#### val

The ID of the Form being assigned to the Job Type

### Example

430545 here is the ID of an example Form assigned to a Job Type with the ID of 122041.

```
FM_api(
    'JobType_setForm',[
        'id' => '122041',
        'val' => '430545'
    ]
);
```

### Result

#### On Success

```
{'ok':1}
```

#### On Failure

If there is no "id" variable or the id given is less than 1:

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

If there is no "val" variable or the value given does not match the ID of any Form:

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

If the "id" given does not match any Job Type:

```
{"error":"job type does not exist"}
```
