Data 360 Inspector

Features · Data pipeline

Data graphs

Objects and joins, the graph as SQL, and one record's graph.

Video coming soon.

From the article What is inside this Data Cloud data graph? (part 16 of the series).

A developer building a Personalization experience or an Agentforce action asks me what the customer data graph returns for one person. In Data Cloud, the data graph builder shows the objects as a canvas you click through one node at a time. It does not show you the JSON document the graph produces, and it gives you no quick way to look at the rows behind it.

A data graph is often where those profiles end up being read, so today is the Data graphs page: each graph's objects and joins, the graph as SQL, and one record's graph fetched by ID.

What a data graph is, in one paragraph

A data graph puts a person's data from several objects (the unified individual, their emails, their orders, their scores) into one JSON document per record. Data Cloud builds those documents ahead of time and keeps them in a table, so Personalization and Agentforce can read a whole profile in one call instead of joining objects at request time. The page says this in its empty state too, for orgs that have no graph yet.

The list

Data graphs in the sidebar lists every graph in the selected data space, with its primary object and status. My demo org has two: DCI Test Customer on Individual and Item DG on Goods Product, both "Ready". The list comes from the DataGraph records in Salesforce, which have the label and the run status, and each graph's definition is read from Data Cloud four at a time.

Pick a graph and the header shows its label and API name, and a details panel with:

  • Primary object, linked to its Objects page.
  • Status and the last run status.
  • Records: how many documents the graph holds.
  • Last refresh, and Refresh: the full refresh schedule and whether incremental refresh is on.
  • Data space and description.

Open in Salesforce opens the graph's record, and Download gives the details, the object list and both SQL queries as a document or a spreadsheet. Below the details are four tabs: Objects, Diagram, SQL and One record.

Objects and joins

The Objects tab shows the graph as an indented table, one row per object, with its children under it.

Data graphs, DCI Test Customer selected: the details with Primary object Individual, Status "Ready", Records 180, Last refresh, Refresh "every 1 day", Data space default and the description; the tabs Objects (3), Diagram, SQL and One record; and the Objects table with Individual as primary object, then indented Contact Point Phone and Contact Point Email, each "Joined to its parent on ssot__PartyId__c = ssot__Individual__dlm.ssot__Id__c", with the fields in the graph.

Each row has three columns:

  • Object: the label (linked to the object's page) and the API name.
  • Joined to its parent on: the join the graph defines, written as child field = parent.parent field, "primary object" for the root, or "not given" when the definition does not say.
  • Fields in the graph: only the fields the graph includes, not every field of the object.

That last column is what developers usually want. It tells them which values exist in the JSON without guessing from the object's full field list.

The Diagram tab draws the same objects with the entity diagram from Day 12, with their relationships and mappings, and the same export options.

The graph as SQL

The SQL tab has two queries, each with Open in a SQL tab.

The first, The graph's objects joined, is a SELECT over the source objects, joined the way the graph joins them. It uses LEFT JOIN, so the primary object's rows stay even when a person has no related rows, and it selects the fields the graph lists (or the keys and the first few fields when the graph lists none). Comments at the top remind you that related records repeat the root row once per match, and that you can add a WHERE on t0 to look at one record.

The SQL tab of DCI Test Customer: "The graph's objects joined" with a generated SELECT of the graph's fields from ssot__Individual__dlm t0, LEFT JOIN ssot__ContactPointPhone__dlm t1 and ssot__ContactPointEmail__dlm t2 on ssot__PartyId__c = t0.ssot__Id__c, LIMIT 100; below it "The built graph" with SELECT Id__c, last_refreshed_on__c, json_blob__c FROM DCI_Test_Customer_1792778941440_VALUE__dlm LIMIT 10; each with Open in a SQL tab.

This query is useful in two situations. Before a graph is built, it shows what the graph will contain for real people. After it is built, it lets you check one person's values in the source objects against what the graph returned, when the two seem to disagree.

When an object in the graph is not in the metadata catalog, or there is no relationship to join it on, the query leaves it out and says so in a comment.

The second query, The built graph, reads the table Data Cloud stores the built graph in: one row per primary record, with the whole graph as JSON in json_blob__c. That is the data Personalization and Agentforce read, as it was at the last refresh.

One record's graph

The One record tab fetches one document the way Personalization and Agentforce get it. Type the primary object's record ID and press Fetch. For my demo graph, whose primary object is the Individual, that is a source Individual ID; for a graph on the unified individual it is a unified ID.

The page shows the exact GET request under the field, so you can reuse it elsewhere. The answer appears in the JSON viewer, opened three levels deep, with the nested json_blob__c decoded. The viewer has Tree, Graph and Text views, a search box, Open all and Close all, Copy and Download .json. Data Cloud sends that blob as HTML-escaped text inside the JSON, so without decoding you would see a long string of " instead of a tree.

The One record tab of DCI Test Customer: the Individual ID 003jV00000E4ryjQAB typed in, Fetch, the line GET /services/data/v68.0/ssot/data-graphs/data/DCI_Test_Customer/003jV00000E4ryjQAB, and the JSON viewer after Open all showing json_blob__c for Jamie Green with ssot__ContactPointPhone__dlm and ssot__ContactPointEmail__dlm arrays.

A 404 gets a sentence instead of a code: use the primary object's record ID, and remember that a graph that has not finished building has no records yet.

The request is a GET. Like every call the Inspector makes, it reads and changes nothing.

Limits

A few things to know:

  • The list comes from SOQL on the DataGraph object. When that query fails, the page falls back to Data Cloud's metadata list, which leaves out graphs that have not finished building.
  • The Objects tab shows a join only when the graph's definition gives it in one step. Otherwise it says "not given", and the SQL tab looks for a relationship in the metadata instead.
  • The joined SQL is my reading of the graph, not Data Cloud's own query. Filters inside the graph definition are not applied.
  • One record shows what the graph holds now. If the last refresh was a while ago, the source objects may already have newer values, which is when the joined SQL helps.