JSON syntax

The JSON-syntax defines what object to create in Lime and what data should be set.

Create object integration

To use this integration, we have to define what kind of object should be created. One object has to be created by the integration, a “main object”, and to this main object we can create several related objects.

In addition to the main object, the integration can create and relate person, company, history and document.

To create the main object, we need to define what kind of object to create and what parameter to set on this object. This is done using a JSON-array syntax where some names and parameters are required, and some are optional.

In order to use this integration you have to have knowledge of the customer Lime database, what objects are available, what their names are and what fields are available and required on each object.

Main object

{
  "object": {
    "lime_object_name": "", // Required. Name of the Lime-object to create
    "person_relation": ""   // Optional. Name of relation-field to the person object on the Lime object
    "company_relation": "", // Optional. Name of relation-field to company on the Lime object
    "summary_field": "",    // Optional. Name of field which will be set with all form data 
    "create_object": {      // Required. Properties to set on the created Lime object. 
                            // Required. A list of properties so set on the object. Cannot be empty.
     }      
}

Main object with minimal parameters

This example will create a Lime object “deal” and set the name of that deal to “New deal”. If the deal object in Lime has other mandatory fields, these values also has to be set in the “create_object” array, which defines all value that should be set.

{
  "object": {
    "lime_object_name": "deal", // Required. Name of the Lime-object to create
    "create_object": {          // Required. Properties to set on the created Lime object.
      "name": "New deal",       // Required. Property to set on the created object. Cannot be empty.
    }
  }
}

Person-relation

If the optional parameter “person_relation” is set in the main object, an additional JSON-array named “person” need to be appended and configured, defining how to find this person and if it should be created if not found (see the example below).

If the person is found or created a relation between the created main object and the person will be set. If the person also is related to a company, this relation will also be set on the main object.

"person": {                                 // Required. Has to be set to “person”
    "lime_object_name": "person",           // Required. Name of the person object
    "lime_search_parameter": "email",       // Optional. Field in Lime that contains the value for finding existing person
    "forms_search_parameter": "forms_email",// Optional. Field in Forms that contains the value for finding existing person
    "company_relation": "company",          // Optional. Name of relation-field to company on the Person object
    "create_object": {                      // Optional. If set, a person will be created if not found. 
      "name": "forms_name",                 // Required. A list of properties so set on the object. Cannot be empty.
      "email": "forms_ email"
    }
}

Company-relation

If the optional parameter “person_relation” is set in the main object, and the optional parameter “company_relation” is set on the person object, we can also append an additional JSON-array called “company”, which will create a company related to the found or created person. Note, if the person already is related to a company, a new company will not be created.

"company": {                        // Required. Has to be set to “company”
    "lime_object_name": "company",  // Required. Name of the company object
    "create_object": {              // Required. Properties to set on the created Lime object.
      "name": "forms_companyname",  // Required. A list of properties so set on the object. Cannot be empty.
      "address": "forms_ address"
    }
  }

In addition to creating the main object, an additional JSON-array named “history” can be appended and configured, which will create a history object related to the main object. This object can also be related to person and company, if “person-relation” and “company-relation” were configured as previously described, and if these optional values are set in the configuration for this object.

"history": {
    "lime_object_name": "history",  // Required. Has to be set to “history”
    "object_relation": "helpdesk",  // Required. How history object is related to the “main object”
    "person_relation": "person",    // Optional. Name of relation-field to person on the history object
    "company_relation": "company",  // Optional. Name of relation-field to company on the history object
    "summary_field": "note",        // Optional. Name of field which will be set with all form data 
    "create_object": {              // Required. Properties to set on the created Lime object.
      "type": "comment"             // Required. A list of properties so set on the object. Cannot be empty.
    }
  }

In addition to creating the main object, an additional JSON-array named “document” can be appended and configured, which will create a document object related to the main object. This object can also be related to person and company, if “person-relation” and “company-relation” were configured as previously described, and if these optional values are set in the configuration for this object.

"document ": {
    "lime_object_name": "document ",// Required. Has to be set to “document”
    "object_relation": "helpdesk",  // Required. How document object is related to the “main object”
    "person_relation": "person",    // Optional. Name of relation-field to person on the history object
    "company_relation": "company",  // Optional. Name of relation-field to company on the history object
    "create_object": {              // Required. Properties to set on the created Lime object.
      "type":  "other"              // Required. A list of properties so set on the object. Cannot be empty.
    }
  }

BankID-receipt as URL

An additional JSON-array named “bankid” can be appended to the objects “object” and “history”, which will add a label (optional) and an URL to the generated BankID-receipt in the BankID Cloud Service.

"bankid": {
    "label": "Signed using BankID", // Optional.A label or prefix (can only be used on Lime multi-line fields)
    "field": "note"                 // Required.Name of field that will be set to the receipt URL
}

In addition to creating the main object, an additional JSON-array named “receipts” can be appended and configured, which will create PDF-files containing Form-and BankID receipts related to the main object. This object can also be related to person and company, if “person-relation” and “company-relation” were configured as previously described, and if these optional values are set in the configuration for this object.

"receipts": {
    "lime_object_name": "document", // Required. Has to be set to a document object, i.e. “document”
    "object_relation": "helpdesk",  // Required. How history object is related to the “main object”
    "person_relation": "person",    // Optional. Name of relation-field to person on the history object
    "company_relation": "company",  // Optional. Name of relation-field to company on the history object
    "create_object": {              // Required. Properties to set on the created Lime object.
        "type": "other"             // Required. A list of properties so set on the object. Cannot be empty.
    }
}