Skip to content

Dialogue Script

Dialogue script is optimized for personalized customer experiences (CX).

Dialogue script executes in script plugins added to pages in the Room Builder.

Dialogue Script Principles:

  • Lots of small, personalized interactions over large monolithic apps and portals.
  • Conversion over content. Each interaction drives next step in “dialogue”.
  • Iterative and agile development. Rapid feedback. Rapid deploy.
  • Data + UX in one environment.

Technical Design Principles:

  • Plain Javascript. No proprietary component framework to learn.
  • Drag-and-drop script plugin into a room builder page.
  • HTML and CSS for rendering and presentation.
  • Query and interact with Salesforce records via the iDialogue REST API.

Scripting Overview

iDialogue scripts support plain Javascript, CSS, and HTML for rendering custom content and customer experiences.

Scripts may query, insert, update, and upsert Salesforce records using the iDialogue REST API.

Global Variables

Scripts have access to two global context variables upon initialization.

roomContext Provides properties and context about the iDialogue room.

memberContext Provides context about the current user / room member.

RoomContext

// To dump all room context properties to browser console:
console.log( roomContext );
// Properties
var roomContext;
roomContext.id; // Reference to a rooms__DocumentRoom__c record.
roomContext.orgId // Reference to the Salesforce org ID
roomContext.url // REST API path to the room instance.
// https://api.i-dialogue.com/v1/orgs/{orgid}/rooms/{roomId}/
roomContext.sessionId // Unique iDialogue room session tied to room member.
roomContext.items // Collection of room items (documents)
roomContext.status // Room status
roomContext.masterRecordId // 18-char ID reference to the record context of the room.
// Example an Opportunity ID
roomContext.masterRecordType // Room context SObject. Example "Opportunity", "Contract", "Lead"
roomContext.opportunityId // For quote rooms. Reference to an Opportunity record
roomContext.accountId // For quote rooms. Reference to an Account record
roomContext.crmId // Room member ID. Could be a user, contact, or lead.
roomContext.memberId // Reference to a rooms__DocumentRoomMember__c record
roomContext.siteId // Reference to the rooms__SiteDefinition__c record used to render the room.

MemberContext

Scripts can access the memberContext variable to personalize content based on the active user.

// To view all properties from a script.
console.log( memberContext );
memberContext.id; // Reference to a rooms__DocumentRoomMember__c record
memberContext.contactId;
memberContext.crmId;
memberContext.firstName;
memberContext.lastName;
memberContext.locale;
memberContext.name;
memberContext.role;
memberContext.salutation;
memberContext.title;
memberContext.type;
memberContext.uniqueId;
memberContext.userId;