# \_exportChanges

Exports a list of changes to a Customer's information as a .csv file, fields can be filtered.

### Parameters

#### customer\_id

The ID of the Customer you wish to export the changes of.

#### f-field

An optional filter that will only include changes to Customer fields which contain the value given.

For example:

* The value "account\_manager" for the **f-field** parameter will make the .csv file only include changes to fields with "account\_manager" in their name.
* If there was a field made with just the name "account", the value "account" for the **f-field** parameter will make the .csv file include any changes to both the "account" and "account\_manager" fields.
* Not giving the **f-field** parameter a value will include all recorded changes in the .csv file.

### Example

```
FM_api('Customer_exportChanges',[
  'customer_id'=>'682978',
  'f-field'=>''
]);
```

### Results

#### On Success

An example where f-field was not given a value

```
Date,User,Field,"Change From","Change To"
2023-10-01,"api tests",credit_terms,,fffffffff
2023-10-01,"api tests",industry,,1
2023-10-01,"api tests",postcode,,35321
2023-10-01,"api tests",county,"tEst county",
2023-10-01,"api tests",landline,012345678,0123456783
```

An example where f-field was given the value "c"

```
Date,User,Field,"Change From","Change To"
2023-10-01,"api tests",account_manager,0,92447
2023-10-01,"api tests",county,"tEst county"
```

#### On Failure

If the "customer\_id" parameter is not set, has a value less than 0 or does not contain any numerical characters:

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

If the "customer\_id" parameter does not match the ID of an existing Customer, or there are no changes recorded:

```
Date,User,Field,"Change From","Change To"
```


---

# 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/customer/_exportchanges.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.
