Conscia Graph
The Graph Components allow you to connect to any Graph instance from Engine and retrieve Collection data.
| Component | Requires Connector | Allows for Personalization |
|---|---|---|
| Static Record List | Yes | Yes |
| Dynamic Record List | Yes | Yes |
Connector Configuration
| Parameter Name | Parameter Property | Description |
|---|---|---|
| Conscia Endpoint | endpoint | One of: Production, Staging, Development |
| API Key | apiKey | Your Graph API token |
| Customer Code | customerCode | Your customer code |
To create a Engine Connection to Graph in the Engine UI:
- Navigate to the Connections page (Manage Flows --> Connections).
- Click Add Connection. The Create Connection page appears.
- For Connection Code, enter a unique idenfier for the Connection, such as
dxgraph-connection. - For Connection Name, enter a friendly name for the Connection, such as "Graph Connection".
- Optionally, enter a Connection Description.
- For Connector, select Graph.
- For Conscia Endpoint, select the appropriate Conscia API endpoint (ie, Production, Staging, or Development).
- For API Key, select Literal, and enter the Conscia Graph API token.
- For Customer Code, enter the Conscia customer identifier for the Graph instance.
- Click Submit.
Especially if multiple Graph Connections use the same API Key, you may want to store that value as a Secret.
Static Record List
A Graph Static Record List Component lets Conscia users select one or more Records in a Graph Collection.
Component Configuration
| Parameter Name | Parameter Property | Description |
|---|---|---|
| Connection Code | connectionCode | The Connection Code of a configured Conscia Graph Connector |
| Collection ID | collectionId | The Collection to access |
| Suggestion Display Template | template | A handlebars template for rendering the suggestion results |
| Title | title | Suggestion List Title |
| Search Fields | searchFields | Array of fields to search |
To create a Graph Static Record List Component in the Engine UI:
- In the top navigation, Navigate to the Experience Components page (Manage Flows --> Components).
- Click Add Component. The Create Component wizard appears.
- For Component Code, enter a unique identifier for the Component.
- For Component Name, enter a friendly name for the Component.
- For Component Type, select Graph - Static Record List.
- Click Submit.
To configure the Graph Static Record List Component, in the Manage Components page:
- Next to the Graph Static Record List Component, click the Edit button. The Edit Component page appears.
- For Connection, select the appropriate Graph Connection.
- For Collection ID, select the Graph Collection that contains the records to appear in this Component.
- For Suggestion Display Template, enter a Handlebars template containing the identifiers of Fields in the Graph Collection, which the Engine UI will display to Conscia users. For example, to show users the
article_idandtitlefields of the Graph Record:
{{article_id}} ({{title}})
- For Search Fields, select fields from the Category that the Engine UI will search when users type values to locate Records from Graph.
Records only appear after the Conscia user enters a value for which search results are available.
Component Experience Rule Configuration
To personalize experiences by presenting different records to different visitors, apply Experience Rules to Graph Static Record List Components.
| Parameter Name | Parameter Property | Description |
|---|---|---|
| Records to show | recordIds | An array of record identifiers to fetch |
Dynamic Record List
A Graph Dynamic Record List Component lets Conscia users specify criteria to determine Records in a Graph collection.
Component Configuration
| Parameter Name | Parameter Property | Description |
|---|---|---|
| Connection Code | connectionCode | The Connection Code of a configured Conscia Graph Connector |
| Collection ID | collectionId | The Collection to access |
| Maximum number of records to return | limit |
To create a Graph Dynamic Record List Component in the Engine UI:
- In the top navigation, Navigate to the Experience Components page (Manage Flows --> Components).
- Click Add Component. The Create Component page appears.
- For Component Code, enter a unique identifier for the Component.
- For Component Name, enter a friendly name for the Component.
- For Component Type, select Graph - Dynamic Record List.
- Click Submit.
To configure athe Graph Dyamic Record List Component, in the Manage Components page:
- Next to the Graph Dynamic Record List Component, click the Edit button. The Edit Component page appears.
- For Connection, select the appropriate Graph Connection.
- For Collection ID, select the Graph Collection that contains the records to appear in this Component.
- For Maximum number of records to return, enter a limit to the number of Records that the Graph Dynamic Record List Component will return.
- Optionally, for Query Filter, specify a Graph Record filter. For example, the following JS Expression will cause the response of this Component to include only Records from the Graph Collection that contain the value
eatin the field namedtitle:
_.assign({},{
"$like": {
"field": "title",
"value": "%eat%"
}
})
- Optionally, for Record Layout Configuration, configure how this Component will format Records from Graph. For example, the following JS Expression will cause the response of this Component to include only the
titlefield from the Records in the Graph Collection.
_.assign({},{
"fieldsToReturn": ["title"]
})
- Optionally, for Preview Template, configure how this Component will display Records from Graph within Conscia Experience Manager and Business Rules configuration preview. For example, the following JS EXPRESSION will loop on each of the records retrieved and display an image and title.
{{#each response.data}}
<div style="display: flex; align-items: flex-start; margin-bottom: 20px;">
<div style="margin-right: 20px;">
<img src="{{poster_en}}" alt="Poster" style="width: 82px; height: 127.556px;" class="fr-fic fr-dii" />
</div>
<div style="flex: 1;">
<div style="font-weight: 600; font-size: 1.5rem; margin-bottom: 10px;">{{temp_search}}</div>
<div style="font-weight: 400; font-size: 1.2rem; color: #444;">{{synopsis_en}}</div>
</div>
</div>
{{/each}}
- Click Submit.
Component Experience Rule Configuration
To personalize experiences by presenting different records to different visitors, apply Experience Rules to Graph Dynamic Record List Components.
| Parameter Name | Parameter Property | Description |
|---|---|---|
| Query Filter | query | |
| Sort results | sort | Array of objects [{fieldName, direction}]- direction must be asc or desc |