Keyfax
  • 📋What is Keyfax?
  • Product Suite
    • Keyfax Administrator Tools
      • System Requirements
      • Installation
      • Logging On
      • Navigation
      • Exclusive Mode
      • Script Levels
        • Master Scripts
          • Category Editing
          • Topic Editing
          • Self-Service Categories
        • System Scripts
          • Cancel
          • Priority Justifications
          • Results
          • Special Instructions
          • Startup
        • Script Sets
          • Category Properties
          • Setting up Topics
          • Topic Properties
          • Loading Script Sets
      • Script Editing
        • Script Editing - The basics
        • References
        • Testing your changes
        • Script Flows
      • Script Entities
        • Databoxes
          • Script Data
            • Host-specific notes
          • SQL Query
            • Testing SQL Query Databoxes
          • Import XML
          • Export XML
          • System Values
          • Company Data
          • Testing Databoxes & Expressions
          • Databox Read
          • Databox Write
          • Databoxes in Messages & Tasks
        • Questions
          • Address
          • Checklist
          • Date/Time
          • Dynamic Lists
            • Testing Dynamic Lists
            • Dynamic List Examples
          • External Forms (eForms)
            • External Forms - Technical
          • File Upload
          • List
          • Numeric
          • Text
          • Video Call
        • Asset Data
        • Markers
        • Messages
          • Testing Messages
        • Services
          • Host-specific notes
        • Priorities
        • Tasks
          • Enclosures & Attachments
          • Continuations
          • Host-specific notes
      • Reports
      • Databox Examples
        • Business Days
        • Working Hours
        • Time of day
        • Higher priority jobs
        • Script Duration
        • How did it happen?
        • Repair Description
        • Concatenating CSV
        • Tenant Handbook
        • Multi-line Addresses
        • Priority / Response Days
        • Contains Text
      • Databox Expressions
        • Text Expressions
          • CSV
          • Entry
          • Exists
          • FieldMerge
          • Index
          • IndexOf
          • InList
          • Item
          • Len
          • ListTidy
          • Lower
          • PadLeft
          • Replace
          • Row
          • RowMerge
          • SubStr
          • Trim
          • Upper
          • WCase
        • Numeric Expressions
          • Abs
          • AsNum
          • Between
          • Int
          • Mod
          • Number
          • Result
          • Round
        • Date Expressions
          • After
          • AsDate
          • Before
          • BetweenDates
          • DateAdd
          • Day
          • Month
          • Now
          • Today
          • WeekDay
          • Year
        • Number Formatting
        • Operators And Literals
        • Logical Expressions
        • Additional Functions
          • Ds
      • Users
        • Finding active users
        • Keyfax SSO – via Microsoft Entra ID Support
      • Advanced
        • Base Task Templates
          • Email Task Templates
          • Letter Task Templates
          • Note Task Templates
          • SMS Task Templates
          • VoiceSage Task Templates
          • Host-specific notes
        • Export & Import
        • Communications Queues
      • Host Operations
        • ActiveH Operations
          • Introduction
          • Actions
          • Databoxes & UDEs
          • Emails
          • Mail Merge Letters
          • Populating CallType
          • Populating JobType
          • Repairs Inspection Task
          • Repairs Interface
        • Fast Lean Smart
      • Best Practices
        • Extracting XML from Keyfax tables
        • Script Performance
        • Handling multiple rows from SQL
        • HTML Editor
        • Writing SQL Queries
      • Known Issues
        • Startup Messages
        • Running but not Visible
        • Error 1001 During Install
        • Stopped Working
    • Keyfax Staff
      • System Requirements
      • Advisor Feedback
      • Priority and Quantity
    • Keyfax Self-Service
      • System Requirements
      • Browser Support
    • KeyNamics
      • Model Driven Apps
      • Power Pages Portals
      • Installation
        • System Requirements
        • Solution Import
        • Basic Setup
        • Known Issues
      • Embedding
        • Model Driven Apps
        • Power Pages Portals
      • Configuration
        • Settings
        • Mappings
          • Creating Mappings
          • Minimum Mapping Requirements
          • Mapping Entity Form Fields
          • Mapping Lookup fields
          • Mapping Examples
        • FetchXML
          • Creating FetchXML queries
        • Logging
        • Test
      • Advanced
        • Mode Translation Rules
        • Customising Launch Button
        • Extending Export Data
        • Mapping Dump Fields
        • Mapping JSON Results
        • Enabling Help Panes
        • Mobile Operation
        • Handling uploaded content
      • Technical
        • Topology
        • Copying Environments
        • Keyfax Startup Data
        • Keyfax Export Data
    • Keyfax Client
      • Installation
        • Getting Started
        • Launch Tester
        • Uninstall / reinstall
        • Known Issues
    • Keyfax Cloud
      • Uptime Guarantee
      • Business Continuity
  • General
    • General FAQs
      • General Questions
      • Installation Questions
      • Migration Questions
      • Security Questions
      • Test & Training Questions
    • Keyfax FAQs
      • Keyfax Administrator Tools
      • Keyfax Staff
      • Keyfax Self-Service
      • KeyNamics
      • Keyfax Client
      • Keyfax Cloud
    • Issues & Solutions
      • Emails not working
    • Release Notes
      • Keyfax
        • 4.4.7
        • 4.4.6
        • 4.4.5
        • 4.4.4
        • 4.4.3
        • 4.4.2
        • 4.4.1
        • 4.4.0
        • Previous Releases
      • Keyfax Client
        • 4.0.0.44
        • 4.0.0.43
        • 4.0.0.42
        • Previous Releases
      • KeyNamics
        • 3.0.0.0
        • 2.0.0.13
        • Previous Releases
      • Older Releases
        • Staff
  • Integrations
    • API Docs
      • REST API
        • Quick Start
        • Deep Dive
        • API SDKs
          • .NET SDK
          • JavaScript SDK
          • Start-Up Data
          • Processing Results
        • API Reference
      • SOAP API
        • Quick Start
        • Error Handling
        • Status Codes
        • XML Schemas
          • Startup Schema
          • Results Schema
          • Results with Note
          • Cancelled Schema
          • Address data
      • Legacy APIs
        • Active X
        • Asynchronous Pluggable Protocols
        • XmlHttp
    • Integrations
      • Aareon
        • Introduction
        • Launching Keyfax Repairs
        • Launching Keyfax Enquiries
        • Configuration
        • SOAP based integration
        • QL Message fields
        • Known problems
      • Accuserve
      • ActiveH Desktop
        • Introduction
        • ActiveH Repair Interface
        • Known Problems
        • Keyfax Configuration
          • MISExchange.xml
          • Example Settings
          • Retrieving Block Codes
        • MIS Configuration
          • Exchange Process
          • Exchange Elements
          • User Permissions
          • User Security
          • UDE Interface
          • UDE Configuration
          • Settings
          • Desktop Configuration
          • Priorities Configuration
          • Populating Job Type
          • Populating Assigned To
          • Populating Call Classification
          • Configuring Log Call
            • Launching Keyfax from Response Repairs
          • Workflow Integration Actions
        • MIS interface Objects
          • CRM Gateway
          • Desktop Task
          • System Task Email Addressee
          • Desktop Task Action
          • Repair Request
          • Repair Request Inspection
          • Repair Request Task
      • ActiveH Portal (TIPS)
        • Introduction
        • Settings
        • Known Issues
      • ActiveH Web
      • Breeze IT
      • Caltech
      • Capita
        • Capita Housing / Academy
          • Host Table Usage
          • Troubleshooting
        • Open Housing
      • Civica
        • Civica CX
          • Introduction
          • Mappings
          • Start Up Data
          • Inspections
          • Known Issues
        • Civica CM
          • Known problems
        • Servitor
          • Example Import XML
          • Example Export XML
      • ContactView
      • Dynamics
      • Kirona
      • Lagan
      • MIS
      • MRI
      • Northgate
        • Launching Keyfax
        • Exchange process
        • XML/Field mappings
      • OneServe
      • ROCC
      • Total Mobile
        • Launching Keyfax (TASK)
        • TotalView Configuration
      • SDM
    • Best Practices
      • Integration Considerations
      • Displaying Keyfax Self-Service
  • Technical
    • General
      • Keyfax Architecture
      • Clearing Cache
    • Cloud Operation
      • Microsoft Azure
      • Amazon Web Services
    • Configuration Settings
      • Introduction
      • Paths Element
    • Developer Zone
      • eForm Technical Details
    • SQL Server
      • Freeing Space
      • Maintaining Indexes
      • Maintenance Plan
      • Restoring Live into Test
  • Links
    • Our Web Site
    • Our Blog
    • Try Keyfax
    • Contact Us
Powered by GitBook
On this page
  • Prerequisites
  • Instructions
  • Updating existing environments
  • Why is a 3.1.0 update necessary?
  • That's It
  1. Product Suite
  2. KeyNamics
  3. Advanced

Mapping JSON Results

Learn how to return Keyfax results as JSON within KeyNamics.

PreviousMapping Dump FieldsNextEnabling Help Panes

Last updated 1 year ago

NOTE The JSON results detailed below are generated on the Keyfax web server using Newtonsoft.JSON. This JSON is more reliable than the client side generated JSON used via the JSON dump field as detailed within Mapping Dump Fields. It's recommended you use the approach detailed below to return JSON if you wish to use JSON to reliably process Keyfax results.

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.

Prerequisites

  1. 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.

  2. 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.

Instructions

  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.

  2. 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...

  1. 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.

  1. 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:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
  <entity name="keyfax_session">
    <link-entity name="keyfax_result" to="keyfax_sessionid" from="keyfax_session_id" link-type="inner">
      <attribute name="keyfax_json" />
    </link-entity>
    <filter type="and">
      <condition attribute="keyfax_guid" operator="eq" value="[BOOKMARK#1]" />
    </filter>
  </entity>
</fetch>
  • 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.

  1. 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.

  1. 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....

Updating existing environments

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...

NOTE The above step will not be necessary once 3.1.0 has officially released and we compile a tested 3.1.0 solution.

Why is a 3.1.0 update necessary?

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.

That's It

If we can assist further please don't hesitate to Contact Us.