Skip to main content

Import data and trigger a business rule

Query without variables

# Query to import a contact and 
# run rules as defined by Decision Tables
mutation{
  importGeneral(withRules:true,rows:{
    contacts:[
      {
        contactId: "testMutation"
        name: "Test Contact"
        type: "1"
        juridical: "PE"
        status: "A"
        taxCountry: "SE"
        language: "SE"
        classification: "NPROF"
        identity: "PASS"
      }
      #append more contact objects here
    ]
    #add import of other object types here
    #portfolios:[]
    #transactions:[]
    #securities:[]
  })
}

Same query with variables

Query

# Query to import something and
# option to run rules from Decision Tables
mutation generalImport($withRules: Boolean, $rows:ImportRowsDTOInput){
    importGeneral(withRules:$withRules,rows:$rows)
}

Variables

{
    "withRules":true, 
    "rows":{
    "contacts":[
      {
      "contactId": "testMutation",
      "name": "Test Contact",
      "type": "1",
      "juridical": "PE",
      "status": "A",
      "taxCountry": "SE",
      "language": "SE",
      "classification": "NPROF",
      "identity": "PASS"
      }
    ]
  }
}

Response (same for both queries above)

{
  "data": {
    "importGeneral": [
      {
        "c.marketingCommunication": "",
        "c.subType": "",
        "c.language": "SE",
        "c.type": "1",
        "c.taxCountry": "SE",
        "c.externalId": "",
        "c.memo": "",
        "c.country": "",
        "c.phone2": "",
        "c.phone1": "",
        "c.juridical": "PE",
        "c.representatives": "*** ,",
        "c.fax": "",
        "c.email": "",
        "c.extContactIdList": "",
        "c.name": "Test Contact",
        "c.status": "A",
        "c.profileAttributes": "",
        "c.classification3": "",
        "c.contactExchanges": "",
        "importStatus": "OK",
        "c.electronicCommunication": "",
        "c.classification2": "",
        "c.transactionExtIdLevel": "1",
        "c.address1": "",
        "c.address2": "",
        "c.tags": "",
        "c.nationality": "",
        "c.city": "",
        "c.classification": "NPROF",
        "c.contactId": "testMutation",
        "c.identity": "PASS",
        "c.prefix": "c",
        "c.zipCode": ""
      }
    ]
  }
}