System Entity Types

As Khoros Flow already supports system entities system.email or system.date, Flow Code Action also extends these system entities with location-based entities such as addresses or postal codes for the developers to trigger the address prompt or choose a location during a conversation.

Implementing the System Entities

Parameter data format

Any extracted system entity should comply with the Flow param format.
Example of an extracted system.address entity:

{

  "your_param_name": {
"address": [

  {

    "value": "1 Infinite Loop, Cupertino, CA 95014, USA",

    "type": "system.address",

    "match": "1 Infinte loop, USA",

    "address": {

      "streetnumber": "1",

      "street": "Infinite Loop",

      "city": "Cupertino",

      "statecode": "95014",

      "postalcode": "2083",

      "area": "Santa Clara County",

      "state": "California",

      "country": "United States",

      "countrycode": "US"

    },

    "coordinates": {

      "lat": 37.3318641,

      "lng": -122.0302537

    }

  }

]
    }

}

If the address service matches with (for example, if the name John Dow matches for email, number, date, etc) the data is added as a param.

  • match: The text that was converted
  • value: Formatted address string
  • location: Object with optional metadata

System entity for address

The system.address entity verifies the address of the users by matching the user location stored in the system.

Data format

Example of the data format for address:

{

  "params": {
"address": [

  {

    "value": "1 Infinite Loop, Cupertino, CA 95014, USA",

    "type": "system.address",

    "match": "1 Infinte loop, USA",

    "location": {

      "streetNumber": "1",

      "street": "Infinite Loop",

      "city": "Cupertino",

      "postalCode": "95014",

      "postalcodeSuffix": "2083",

      "area": "Santa Clara County",

      "state": "California",

      "stateCode": "CA",

      "country": "United States",

      "countryCode": "US"

    },

    "coordinates": {

      "lat": 37.3318641,

      "lng": -122.0302537

    }

  }

]
     }

}

Access Addition Parameter

The following parameters can be used for matching the address and postal codes with the system:

Country: {{myParam[0].address.country}}
Postalcode: {{myParam[0].address.postalcode}}