Skip to main content

Relewise

The Enterspeed Relewise integration uses the destinations field to send data from views directly to a configured Relewise account. This means that you can decide on schema level which views you want to send to Relewise.

You will only have to set the destination field on the entity schema you want to send to Relewise. All schema references are automatically resolved so you don't have to set it on all referenced schemas.

It's possible to configure multiple Relewise destinations if you need to push different types of data to different Relewise accounts.

Configuration

In order to setup the Relewise configuration you need the following:

SettingDescription
Relewise Dataset IdThe unique Dataset Id for the Relewise account you want to integrate to
Relewise Server URLThe Server URL for the Relewise account you want to integrate to
Relewise API KeyA Relewise API key with update and administrative action permissions for the types you want to integrate (product, content, brand, ...)
Enterspeed Environment Client API KeyThe API key for an Enterspeed Environment client. This is used to fetch the view that will be inserted into Relewise

Options

Table of available options, that you can optionally specify, if needed for your use case.

SettingDescription
idBy default Enterspeed uses view id as the value for object id in Clerk. You can override default object id by providing value for this option.
relewiseEntityTypeThe type of entity you want to send to Relewise. Supported values: product, productCategory, content, contentCategory and brand.

IntelliSense

In order to send data to Relewise (products, content, ...) the structure of the object you are mapping in the properties function must match with the corresponding Relewise model. See Relewise API in Swagger.

To help you bulding the right model, Enterspeed can provide you with IntelliSense. Simply just change the type in the top of the schema from /** @type {Enterspeed.FullSchema} */ to one of the following:

  • /** @type {Enterspeed.Destinations.Relewise.Schemas.Product} */
  • /** @type {Enterspeed.Destinations.Relewise.Schemas.Content} */
  • /** @type {Enterspeed.Destinations.Relewise.Schemas.Brand} */
  • /** @type {Enterspeed.Destinations.Relewise.Schemas.ProductCategory} */
  • /** @type {Enterspeed.Destinations.Relewise.Schemas.ContentCategory} */

Example of usage

Product schema with Relewise destination
/** @type {Enterspeed.Destinations.Relewise.Schemas.Product} */
export default {
triggers: function(context) {
context.triggers('pim', ['product']);
},
actions: function (sourceEntity, context) {
context.destination('relewise').options({
id: sourceEntity.originId,
relewiseEntityType: 'product'
});
},
properties: function ({properties: p}, context) {
return {
product: {
displayName: {
values: [
{
language: { value: "en-gb" },
text: p.productName
}
]
},
salesPrice: {
values: [
{
amount: p.salesPrice,
currency: { value: "Euro" }
}
]
}
},
variants: context.reference('variantSchema').children()
}
}
}
Content schema with Relewise destination
/** @type {Enterspeed.Destinations.Relewise.Schemas.Content} */
export default {
triggers: function(context) {
context.triggers('cms', ['contentPage']);
},
actions: function (sourceEntity, context) {
context.destination('relewise').options({
id: sourceEntity.originId,
relewiseEntityType: 'content'
});
},
properties: function ({properties: p}, context) {
return {
displayName: {
values: [
{
language: { value: "en-gb" },
text: p.title
}
]
},
data: {
contentData: {
type: "String",
value: p.text
}
}
}
}
}

What's supported

The integration supports the following types: product (with variants), productCategory, content, contentCategory and brand and the type needs to be defined in the relewiseEntityType property in the destination options together with a value for the id you want in Relewise.

See more details on the Relewise documentation: https://docs.relewise.com/docs/developer/implementation-steps.html#_1-provide-entities

info

All updates are done with UpdateKind.ClearAndReplace and all administrative actions are done with UpdateKind.Disable