Mapping JSON Results
Learn how to return Keyfax results as JSON within KeyNamics.
Last updated
Was this helpful?
Learn how to return Keyfax results as JSON within KeyNamics.
Last updated
Was this helpful?
The JSON stored within the keyfax_json
column within the keyfax_result
entity within KeyNamics is populated via the <ResultJson/>
element returned from the GetResults
SOAP based web service ran on the Keyfax web server.
To update a field on an entity form using "Receive from Keyfax" mappings with the JSON stored within the keyfax_result.keyfax_json
column please follow the steps below.
Ensure your Keyfax installation is using the "KeyNamics" export templates. This will ensure all JSON properties that should be represented as arrays are actually returned as arrays even if there is only 1 item returned.
Ensure Keyfax is set-up to return JSON results from the GetResult
SOAP API end-point on the Keyfax web server. Ensure the SOAP/GetResult/@resultJson
attribute within Keyfax configuration on the web server is set to 1.
Ensure the KeyNamics environment has been updated to KeyNamics 3.1.0+ or is running the latest Keyfax.CRM.Solution.dll
assembly - see "Updating existing environments" below.
Add a new multi-line text field to the desired entity form, this field will be populated with the value from keyfax_result.keyfax_json
. This field should have a maximum length of 1,048,576
as shown below...
Make a note of the logical field name. We''ll need this later for the target within our final mapping. For now ensure the field is added to the entity form and the entity form is published after being updated. You can see an example below of the field we added during testing...
Create a new "Receive from Keyfax" mapping with a name & source of "GUID" as shown below...
Ensure the target
is null
as we'll only use this GUID mapping to obtain the Keyfax GUID to later perform a FetchXML query. This won't be used to update any entity form fields.
Create a new FetchXML statement using the previously created GUID mapping as a bookmark as shown below...
The FetchXML statement is included below...
Name: Fetch keyfax_result.keyfax_json using Keyfax GUID
Fetch XML:
Bookmark 1: GUID
This FetchXML simply selects the keyfax_json
column from the keyfax_result
entity using the Keyfax GUID and the relationship that exists between sessions and results within KeyNamics.
Finally create a new mapping to populate the multi-line text field we added to the entity form in step 2 with the result produced via the FetchXML statement created in step 4. above
The "Target" field should be the logical field name of the field we wish to update on the entity form.
Verify Results
Complete a Keyfax script and you should see the entity form field created in step 2 above is updated with the value from the keyfax_result.keyfax_json
column....
At the time of writing KeyNamics 3.1.0 has not been released. If this update needs to be applied within a D365 environment before 3.1.0 is released we would need to update the Keyfax.CRM.Solution.dll
assembly within the target environment with a version from source control. The plug-in registration tool should be used to update this assembly as shown below...
To allow mappings to query the keyfax_result
entity using FetchXML the order in which the results are created has been changed. Results are now added to the keyfax_result
entity before "Receive from Keyfax" mappings are constructed.
If we can assist further please don't hesitate to Contact Us.