# \_setFieldImage

Sets the Image of a Field within a Job Form.

### Parameters

#### jpeg

The base64 data of the image to be set.

#### id

The ID of the Job.

#### name

The name of the Form Field to set an image to.

### Example

```
FM_api('Job_setFieldImage',[
    'jpeg'=>'data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAANCAYAAABPeYUaAAAAdUlEQVR42rWS6w3AIAiEIWGSDtehOlxXoekDFXz0TFr+Kebz7kCISKldTGDJoKcoOEPWxXe2vQdmXMkJNZB9cJ8rkDwXej0o1USABzuQ0AclQA49m0nNu5ISbNYCSICd0GFOYCZcAYPt2WC5sYj6w3TmFCU1B1lyJCTX7HJyAAAALXRFWHRTb2Z0d2FyZQBieS5ibG9vZGR5LmNyeXB0by5pbWFnZS5QTkcyNEVuY29kZXKoBn/uAAAAAElFTkSuQmCC',
    'id'=>'772025',
    'name'=>'test field name'
  ]
);
```

#### On Success

```
{"ok":1,"val":"{\"src\":\"92447x1774198864066.jpg\"}"}
```

#### On Failure

If the "jpeg" parameter is not set:

```
{"error":"no jpeg parameter supplied"}
```

If the "id" parameter is not set or has an integer less than 1:

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

If the "name" parameter does not have a value when trimmed:

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

If the "id" parameter does not match an existing job:

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

If the job form does not have a field which matches the "name" parameter:

```
{"error":"no field by that name exists in the job's form"}
```


---

# 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/job/_setfieldimage.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.
