Capturing User Operations using Platform Event API
Some user operations performed in the Mashmatrix Sheet application can be captured by external programs using the Salesforce platform's platform event mechanism. This enables performing additional processing when users perform specific operations in Mashmatrix Sheet, or recording operation details in logs.
Types of Operations that Can Be Captured
Save Records
Event fired when record saving is performed from Mashmatrix Sheet
Platform Event Name
msmxSheet__SaveRecords__e
Fields Included in Event
Book ID (BookId__c) - ID of the book where record saving was executed
Sheet ID (SheetId__c) - ID of the sheet where record saving was executed
Object Name (ObjectName__c) - Name of the Salesforce object being saved
Operation Type (OperationType__c) - Type of record saving operation. One of create / update / destroy.
Num of Saving Records (RecordNum__c) - Number of records to be saved
Success (Success__c) - Flag indicating whether saving was successful (true/false)
Num of Success Records (SuccessRecordNum__c) - Number of records that were successfully saved
Success Record IDs (SuccessRecordIds__c) - List of record IDs that were successfully saved (comma-separated, up to 5,000 records)
Num of Error Records (ErrorRecordNum__c) - Number of records that failed to save
Error Record IDs (ErrorRecordIds__c) - List of record IDs that failed to save (comma-separated, up to 5,000 records)
Error Message (ErrorMessage__c) - Error message from saving operation
User ID (UserId__c) - ID of the user who executed the record saving
Execute Query
Event fired when record queries are executed from Mashmatrix Sheet
Platform Event Name
msmxSheet__ExecuteQuery__e
Fields Included in Event
Book ID (BookId__c) - ID of the book where record query was executed
Sheet ID (SheetId__c) - ID of the sheet where record query was executed
Object Name (ObjectName__c) - Name of the Salesforce object being queried
Query SOQL (Query__c) - Executed query statement (SOQL)
Success (Success__c) - Flag indicating whether query was successful (true/false)
Num of Queried Records (RecordNum__c) - Number of records retrieved by query
Record IDs (RecordIds__c) - List of record IDs retrieved by query (comma-separated, up to 5,000 records)
Error Message (ErrorMessage__c) - Error message
User ID (UserId__c) - ID of the user who executed the record query
Download
Event fired when CSV download is performed using download action button from Mashmatrix Sheet
Platform Event Name
msmxSheet__Download__e
Fields Included in Event
Book ID (BookId__c) - ID of the book where download was executed
Sheet ID (SheetId__c) - ID of the sheet where download was executed
Num of Downloaded Records (RecordNum__c) - Number of records to be downloaded
Record IDs (RecordIds__c) - List of record IDs downloaded (comma-separated, up to 5,000 records)
User ID (UserId__c) - ID of the user who executed the download
Creating Clients using Salesforce Flow
Salesforce Flow is a typical choice for clients that capture platform events. Mashmatrix Sheet operation events can also be captured through flows.
To capture Mashmatrix Sheet operation events, create a new platform event-triggered flow using Flow Builder.

In the platform event selection screen, search for and select the type of event you want to capture.

Use platform event field values as conditions to branch flow execution or configure additional actions and notification processing. The example in the image below sends an email to administrators when the number of target records for download operations exceeds 1,000.


Differences from Message Channel API
Message Channel API, which uses Lightning Message Service for message transmission, is used for message exchange within Lightning pages, while messages from Platform Event API can mainly be used for server-side processing hooks.
Additionally, Message Channel API can only be used in screens where Sheet components are embedded, but Platform Event API covers operation content on all screens including Mashmatrix Sheet application screens.
Last updated