Contextual Alerts in Financial Services Cloud with Data 360: Build a Large Deposit Alert Step by Step

how to setup Contextual Alert in fsc using data cloud

In FINSforce Episode 15 we build a contextual alert end to end: Data 360 (formerly Data Cloud) learns each client’s normal deposit pattern and raises a Record Alert in Financial Services Cloud when a deposit is far above it. No Apex, no hard-coded amount: just a data stream, one SQL calculated insight and one flow.

Watch the video

Prefer to watch?

The full walkthrough is on the FINSforce YouTube channel.

What is a contextual alert?

A contextual alert judges a transaction against the client’s own history, not against a fixed number.

Take a bank customer in India whose account suddenly receives β‚Ή15 lakh, and the money is withdrawn at an ATM a few hours later. Banks often freeze such an account until the customer re-does KYC. But nobody at the bank reads every transaction by hand. The system has to spot the large deposit and raise an alert, so the relationship manager can call the client and the compliance team can check where the money came from.

Why not a simple rule like “alert on any deposit over β‚Ή15 lakh”? Because “large” depends on the client. For someone who deposits β‚Ή10,000 a month, β‚Ή15 lakh is huge. For a business that moves crores, it is a normal Tuesday. A contextual alert works out each account’s average deposit and a threshold above it, then flags only what is unusual for that client.

How the data flows

The first five steps happen in Data 360; the flow and the alert live in Salesforce core.

  1. CSV upload. We have no core banking system in the demo, so a CSV file stands in for it.
  2. Data stream. The CSV is loaded into Data 360 with upsert, so new transactions add to the old ones.
  3. Mapping. The stream is mapped to the standard Financial Account Transaction data model object (DMO).
  4. Validation. Data Explorer confirms all rows landed with amounts, dates and the right Financial Account.
  5. Calculated insight. SQL works out each account’s average deposit and threshold, and returns any deposit above it.
  6. Data Cloud-triggered flow. Every new insight row starts the flow.
  7. Find the client. The flow looks up the Financial Account Party to reach the client’s Account.
  8. Record Alert. The flow creates a Record Alert, and the advisor sees it on the client’s page.

Resources from the video

Everything used in the build, ready to copy. Replace the sample Financial Account ID 0c7dN0000008GcHQAU with your own before uploading.

ResourceWhat it is forDownload
fsctransaction_v2.csv10 sample transactions (9 deposits, 1 withdrawal) for the first upload[Add link]
fsctransaction_test_txn1011.csvOne β‚Ή15,00,000 deposit (TXN-1011) for the live test[Add link]
large_deposit_alert_insight.sqlThe calculated insight SQL plus both flow formulas[Add link]
Large Deposit Contextual Alert – FINSforce Build Guide (PDF)12-page written guide with every click, field mapping and fix[Add link]
EP14: Record Alerts in FSCThe episode that sets up Record Alerts and the alert card[Add link]

Step 1: Check your org first

Four checks save you hours later:

  1. Standard data model. Setup β†’ Object Manager β†’ search Financial Account. If there is no FinServ__ prefix, you are on the standard FSC data model. New learning orgs have it by default; managed-package orgs need to move to it first.
  2. Relationships. Financial Account Transaction has a FinancialAccountId master-detail to Financial Account. Financial Account Party links the Financial Account to the client’s Account.
  3. Data 360 access. Assign yourself the Data Cloud Admin and Data Cloud for Financial Services Cloud Admin permission sets. Give the advisor or relationship manager who will see the alerts Data Cloud for Financial Services Cloud User. If Data 360 is not set up yet, open Data Cloud Setup and follow the steps.
  4. A demo client. You need a person account, a Financial Account, and a Financial Account Party joining them. In the video we use Jane Smith and her Saving Account from EP14.

Then copy the Financial Account record ID from its URL. Not the client’s Account ID: Account IDs start with 001 and the transactions will never join.

Step 2: Prepare the sample data

The CSV plays the role of your core banking system. Salesforce doesn’t store every transaction; they come from the bank’s core system.

Paste your Financial Account ID into every row of fsctransaction_v2.csv. Each row has a transaction ID, type (Deposit or Withdrawal), transaction and posted dates, amount, description, debit/credit indicator, running balance and status (Posted means the transaction is complete).

Why 10 rows and not 3? With very few deposits, no value can ever cross average + 2 standard deviations. You need at least 6 regular deposits on an account for one outlier to trigger. Keep all dates within the last 365 days, because the insight ignores older ones.

Step 3: Create the data stream

  1. App Launcher β†’ Data Cloud β†’ Data Streams β†’ New.
  2. Choose File Upload and upload fsctransaction_v2.csv.
  3. Name the object and set the data stream name to Financial Account Transaction.
  4. Primary key: TransactionIdentifier.
  5. Check data types: Amount must be a Number (not Currency), and TransactionDate and PostedDate must be Date Time.
  6. Data space default β†’ Deploy.
  7. Refresh until Last Run Status shows Success and Last Processed Records shows 10.

The stream is created with the Profile category, which works for calculated insights.

Step 4: Map to the Financial Account Transaction DMO

On the stream’s Data Mapping card click Start, select your data lake object, then add the standard Financial Account Transaction object. Some fields map automatically; map the rest by clicking the source field, then the target field.

CSV fieldDMO field
TransactionIdentifierFinancial Account Transaction Id (primary key)
FinancialAccountIdFinancial Account
AmountTransaction Amount
TransactionDateTransaction Date
PostedDateTransaction Posted Date
TypeFinancial Account Transaction Type
SubTypeTransaction Sub Type
StatusFinancial Account Transaction Status
DebitCreditIndicatorCash Flow Type
DescriptionDescription
RunningBalanceRunning Balance
MerchantCategoryCodeMerchant Category Code
SourceSystemIdentifierSource System Identifier

The SQL in Step 6 depends on three of these: Transaction Amount, Transaction Date and Transaction Type. Click Save.

Step 5: Validate the data

Data Cloud β†’ Data Explorer β†’ Object type Data Model Object β†’ Financial Account Transaction. You should see 10 rows, all on your Financial Account ID, with amounts and dates filled in. Don’t move on until you do.

Step 6: Build the Large Deposit calculated insight

This is where the context comes from. For each Financial Account, the insight uses the last 365 days of deposits and flags a deposit as large when:

\text{Deposit amount} \geq \text{average deposit} + 2 \times \text{standard deviation}
  1. App Launcher β†’ Calculated Insights β†’ New.
  2. Data space default β†’ Calculated Insight β†’ Next.
  3. Choose the SQL option β†’ Next.
  4. Delete the grey template text in the editor first. Download SQL
  5. Paste the SQL below β†’ Check Syntax β†’ you should see Valid Syntax.
  6. Name it Large Deposit Alert β†’ Next.
  7. Schedule it (every 1 hour in the video) β†’ Enable. To test without waiting, use Run Now from the dropdown next to Edit.
SELECT ssot__FinancialAccountTransaction__dlm.ssot__Id__c as TransactionId__c,
       ssot__FinancialAccountTransaction__dlm.ssot__FinancialAccountID__c as FinancialAccountId__c,
       ssot__FinancialAccountTransaction__dlm.ssot__TransactionDate__c as TransactionDate__c,
       SUM(ssot__FinancialAccountTransaction__dlm.ssot__TransactionAmount__c) as DepositAmount__c,
       SUM(sub2.Average__c) as AverageDeposit__c,
       SUM(sub2.StandardDeviation__c) as StandardDeviation__c,
       SUM(sub2.UpperBound__c) as Threshold__c
FROM ssot__FinancialAccountTransaction__dlm
JOIN (
    SELECT sub1.FinAcct__c as FinAcct__c,
           SUM(sub1.avg__c + 2 * sub1.std__c) as UpperBound__c,
           SUM(sub1.std__c) as StandardDeviation__c,
           SUM(sub1.avg__c) as Average__c
    FROM (
        SELECT ssot__FinancialAccountTransaction__dlm.ssot__FinancialAccountID__c as FinAcct__c,
               STDDEV(ssot__FinancialAccountTransaction__dlm.ssot__TransactionAmount__c) as std__c,
               AVG(ssot__FinancialAccountTransaction__dlm.ssot__TransactionAmount__c) as avg__c
        FROM ssot__FinancialAccountTransaction__dlm
        WHERE ssot__FinancialAccountTransaction__dlm.ssot__FinancialAccountTransactionType__c = 'Deposit'
          AND ssot__FinancialAccountTransaction__dlm.ssot__TransactionDate__c > date_sub(current_date(), 365)
        GROUP BY ssot__FinancialAccountTransaction__dlm.ssot__FinancialAccountID__c
    ) as sub1
    GROUP BY sub1.FinAcct__c
) as sub2
  ON sub2.FinAcct__c = ssot__FinancialAccountTransaction__dlm.ssot__FinancialAccountID__c
WHERE ssot__FinancialAccountTransaction__dlm.ssot__FinancialAccountTransactionType__c = 'Deposit'
  AND ssot__FinancialAccountTransaction__dlm.ssot__TransactionDate__c > date_sub(current_date(), 365)
  AND ssot__FinancialAccountTransaction__dlm.ssot__TransactionAmount__c >= sub2.UpperBound__c
GROUP BY ssot__FinancialAccountTransaction__dlm.ssot__Id__c,
         ssot__FinancialAccountTransaction__dlm.ssot__FinancialAccountID__c,
         ssot__FinancialAccountTransaction__dlm.ssot__TransactionDate__c

How the SQL works, in three layers:

  • sub1 (inner): the average and standard deviation of deposits for each Financial Account.
  • sub2 (middle): turns those into the threshold, average + 2 standard deviations.
  • Outer query: keeps only deposits at or above the threshold. The three GROUP BY columns become the insight’s dimensions; the SUM columns are its measures.

Check the result in Data Explorer β†’ Object type Calculated Insights β†’ Large Deposit Alert. Right after creation it may show no rows while it is still processing.

Step 7: Create the Data Cloud-triggered flow

Every new row in the insight starts this flow. It finds the client and creates one Record Alert. The flow has three parts: Start, Get Records and Create Records.

Start. Switch to the Automation app β†’ Flows β†’ New β†’ search Data Cloud β†’ Data Cloud-Triggered Flow. Data space default, object Large Deposit Alert (your calculated insight), trigger when a record is created, no entry conditions.

Get Records. Label it Get Account Owner Party. Data source Salesforce Object, object Financial Account Party, condition Financial Account ID equals the triggering record’s FinancialAccountId.

Two formula resources. New Resource β†’ Resource Type Formula. In formulas, type field names with __c.

API nameData typeFormula
fValidUntilDate/Time{!$Flow.CurrentDateTime} + 30 (the alert expires in 30 days)
fAlertDescriptionTextsee below
"Deposit of " & TEXT(ROUND({!$Record.DepositAmount__c},0)) & " (txn " & {!$Record.TransactionId__c} & ") is above this account's normal range: avg " & TEXT(ROUND({!$Record.AverageDeposit__c},0)) & ", threshold " & TEXT(ROUND({!$Record.Threshold__c},0)) & ". Contact client re source of funds and next-best-action."

Create Records. Label it Create Large Deposit Alert, set values manually, object Record Alert:

Record Alert fieldValue
Effective Start DateRunning Flow Interview β†’ Current Date/Time
Valid Until DatefValidUntil
SubjectLarge deposit detected
Parent Record IDTriggering record β†’ FinancialAccountId
What Record IDGet Account Owner Party β†’ Account ID
Source System IDTriggering record β†’ TransactionId
ActiveTrue
SeverityWarning
DescriptionfAlertDescription

Save and activate. Name the flow Large Deposit Contextual Alert and click Activate. If activation fails on the description formula, open the resource, paste the formula again with no extra quotes, and click Check Syntax before saving.

Step 8: Test it live

The flow only fires for insight rows created after it is active, so the test needs a new large deposit.

  1. Data Streams β†’ your transaction stream β†’ Update File β†’ Upsert (not Full Refresh).
  2. Upload fsctransaction_test_txn1011.csv: one β‚Ή15,00,000 deposit, TXN-1011 β†’ Deploy.
  3. Wait for Success with 11 total records. In the video the upsert took about 10 minutes.
  4. Run the insight (Run Now, about 1 minute). The alert appears about 2 minutes later.
  5. Open the client’s Account. The alert card shows Large deposit detected with the amount, transaction ID, average and threshold. Click it to see the full Record Alert, linked to the client and the Financial Account.

How the threshold adapts. In the demo, the threshold worked out to about β‚Ή12,37,482, so the β‚Ή15 lakh deposit crossed it. If a client keeps depositing β‚Ή15 lakh, their average and threshold rise with it, and those deposits stop being flagged. That is the point: “large” is always measured against the client’s own pattern. You can change the look-back window in the SQL (the 365 in date_sub) to 30, 60 or 90 days.

Abhishek Verma

Your instructor

Abhishek Verma

Salesforce architect specialising in Financial Services Cloud. I built FINSforce to make FSC easier to learn, with a video and a written guide for every topic, from the data model to certification.

Ask a question about this topic

Your email address will not be published. Required fields are marked *