# Mapping Dump Fields

Rather than create **'Receive from Keyfax' Mappings** for every possible item of data, it may be advantagous to simply 'dump' snippets of the export data generated by Keyfax scripts into large text fields located on the Dynamics form (that launched Keyfax).\
\
This may be useful where the data doesn't need to be split out, field by field, but can be accessed in its raw form. It may be that this data might be handled and broken out by internal processes or workflows, or be forwarded to another system, more or less, as-is.\
\
In order to dump snippets of the export data, simply create Mappings into **Target** fields using the naming convention as per these examples:

* **cust\_dump** - will output to a text field named cust\_dump in XML format (the default)
* **cust\_xmldump -** as above
* **cust\_diagnosticdump -** will output XML&#x20;
* **cust\_jsondump** - will output JSON
* **cust\_jsondiagnosticdump** - will output JSON
* **cust\_diagnosticjsondump** - JSON, again&#x20;

Ignoring the *prefix*, **Target** fields with any of these names will usually be Text fields on your form. **Make sure these are large enough** to hold the maximum amount of expected data. As a guide, a fairly 'standard' **Repair Diagnostic** produces export data of around 2.5KB of export data. This will be larger for **Enquiry** or other script types.\
\
So, any Target field name **ending with the keyword 'dump'** will deliver raw **XML** from the export data. If the keyword **'json'** appears anywhere in the name, it will be delivered in **JSON** format.

### JSON

{% hint style="warning" %}
**IMPORTANT** The JSON produced by the JSON dump functionality does not support deeply nested objects and does not consistently represent arrays. For more complex scenarios were reliable JSON is required please see [mapping-json-results](https://docs.keyfax.biz/product-suite/keynamics/advanced/mapping-json-results "mention").
{% endhint %}

Here's an example Mapping. This will read the **Repair** node(s) from the Keyfax diagnostic's export data and will output it in JSON format to the field '**keyfax\_jsondump**':

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2FFONnmuOfsk0CwNGSZY7g%2Fimage.png?alt=media&#x26;token=59d7720b-20ff-4865-bc09-a0cb1ebfe9ae" alt=""><figcaption></figcaption></figure>

...which may result in content such as this (note: '**root**' unsurprisingly is always the *root* node!):

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2Fxuu1CQuahl9ihGFIfLoG%2Fimage.png?alt=media&#x26;token=8783c283-dd9f-4636-9a9d-4603499aaabf" alt=""><figcaption></figcaption></figure>

### XML

Similarly a mapping such as this will dump the snippet at **Repair** into a field named **keyfax\_xmldump**:

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2Fy8aLHyEYDUxBjsoAYzZG%2Fimage.png?alt=media&#x26;token=dc799aed-3e70-44a9-baa7-b0e873a2428c" alt=""><figcaption></figcaption></figure>

...resulting in content such as this:

<figure><img src="https://2882349412-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MARm6St_qFGM52R3pBa%2Fuploads%2Fu6CbwYqS8mFZFaDxJVDs%2Fimage.png?alt=media&#x26;token=7858d965-6a8e-48ec-ba23-98abc5c8aa8f" alt=""><figcaption></figcaption></figure>
