<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Duong VU Ta on Medium]]></title>
        <description><![CDATA[Stories by Duong VU Ta on Medium]]></description>
        <link>https://medium.com/@vutaduong97?source=rss-715bed1caf0c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*v61jEsscJ8Uo8cgf.jpg</url>
            <title>Stories by Duong VU Ta on Medium</title>
            <link>https://medium.com/@vutaduong97?source=rss-715bed1caf0c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 13:22:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vutaduong97/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Salesforce Dashboard to SQL: A Practical Reverse-Engineering Guide with the Help of Gemini]]></title>
            <link>https://medium.com/refined-and-refactored/from-salesforce-dashboard-to-sql-a-practical-reverse-engineering-guide-with-the-help-of-gemini-fb6cebf2e132?source=rss-715bed1caf0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb6cebf2e132</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[business-intelligence]]></category>
            <dc:creator><![CDATA[Duong VU Ta]]></dc:creator>
            <pubDate>Wed, 11 Feb 2026 09:21:34 GMT</pubDate>
            <atom:updated>2026-02-11T09:21:34.401Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>From Salesforce Dashboard to SQL: A Practical Reverse-Engineering Guide with the help of Gemini</strong></h3><p><strong>How to map frontend metrics to backend tables when there’s no documentation</strong></p><h3>Salesforce Dashboard to SQL</h3><p>Recently, I was given a task:</p><blockquote><strong>“Study the client’s Salesforce dashboard beforehand so we can speed up data mapping with the client during the migration.”</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pCWRjFFLSSvZPourwS-wTA.png" /></figure><p>Sounds simple, right? Identify the source logic, match it to the warehouse fields, and the mapping is complete.</p><h4>Except this dashboard was built entirely in Salesforce using drag-and-drop:</h4><ul><li>No SQL scripts</li><li>No backend queries</li><li>No documentation</li><li>Only friendly labels and aliases</li></ul><p>So you’re stuck in email threads asking:</p><p><em>“Hey… where does this metric come from?”</em></p><p>Back and forth. For days. There has to be a better way. Right? RIGHT!</p><h3>The solution: Inspect Element is your best friend 🦸</h3><p>Even though Salesforce hides the logic, the browser doesn’t.</p><p>Every dashboard component ultimately pulls data through:</p><ul><li>Network API calls</li><li>JSON payloads</li><li>Report metadata</li></ul><p>If you can read that, you can uncover:</p><ul><li>Real object names</li><li>Field API names</li><li>Calculated column logic</li><li>Filters and aggregations</li><li>The exact report powering the chart</li></ul><p>No SQL required.</p><h3>Step 1 — Open the underlying report</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vzMwTu4xoy2JJa4XWuGxEg.png" /></figure><p>From any Salesforce dashboard:</p><ol><li>Find the chart or table you care about</li><li>Click <strong>“View Report”</strong></li></ol><p>This opens the actual report behind the visualization — the true source of the metric.</p><h3>Step 2 — Inspect the network traffic</h3><h4>2.1 Open DevTools</h4><ul><li>Right-click → <strong>Inspect</strong></li><li>Or use:</li><li><strong>Ctrl + Shift + C</strong> (Windows) or <strong>Cmd + Option + C</strong> (Mac)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMg592O5ZdQ8AWb6o0zjJQ.png" /></figure><h4>2.2 Go to the Network tab</h4><p>This is where Salesforce loads the report data as JSON.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8uy6k9TIH2FOqBLm8l_dPw.png" /></figure><p>You’ll usually see two situations:</p><ul><li>✅ Too many requests</li><li>❌ No requests yet</li></ul><p>If it’s messy → hit <strong>Clear</strong> 🧹</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXq9_2SQ5ZMph4ViiqzUsg.png" /></figure><p>Then interact with the report (sort a column, change a filter) to trigger a fresh API call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvvmM4LiagTG4cGKhyxnDA.png" /></figure><h4>2.3 Find the correct payload</h4><p>Open the latest network request → <strong>Preview</strong> tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_eMD2Sk2XeLO372RC7WsJA.png" /></figure><p>Search inside the JSON using <strong>Ctrl + F </strong>(Windows/Linux) or <strong>Cmd + F</strong> (Mac):</p><ul><li>reportMetadata</li><li>reportExtendedMetadata</li></ul><p>These contain everything:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*2o8IHQmfMAXAi1ZDbOTcgQ.png" /></figure><p>Now you finally see the <strong>real API field names</strong> behind those friendly dashboard labels.</p><h4>Grouped columns</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wsuCbcQmq_Vue1-HGf6JKQ.png" /><figcaption>The column colored in gray is the grouped column, these column can be located in the <strong>groupingColumnInfo</strong></figcaption></figure><h4>Normal columns</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*08zwLoCzPFhgO6ixz_znww.png" /><figcaption>The column colored in white is the normal column, these column can be located in the <strong>detailColumn</strong> or <strong>detailColumnInfo</strong> looking in the later will give you the exact matching when looking at the label.</figcaption></figure><h4>Custom formula field</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xMKQ4Y2l9JeIjU0wOJrK5A.png" /><figcaption>Custom column has a Fx symbol next to them, the formula for this can be located in the <strong>customDetailFormula</strong> and check the label for the correct name on the report.</figcaption></figure><h4>Filters</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yokSYJkPP_Kasrcxv4k6Xg.png" /><figcaption>Filter can be located in the reportFilters and the standardDateFilter</figcaption></figure><h3>Step 3 — Translate to SQL</h3><h4>Example 1 — Simple field</h4><p><strong>Salesforce field:</strong></p><pre># Example table and column<br>Table__t.Col_name__c </pre><p><strong>SQL:</strong></p><pre>select tt.col_name_c<br>from `{schema}.{dataset}.table_t` tt</pre><h4>Example 2 — Lookup / Join</h4><p><strong>Salesforce:</strong></p><pre># Example table and column<br>Table__t.New_Table__t.Col_name__c</pre><p>This means:</p><ul><li>Main table → Table__t</li><li>Foreign key → New_Table__t</li><li>Target column → Col_name__c</li></ul><h4>How to identify the correct join target</h4><p>Salesforce doesn’t explicitly show the join table name in the UI, but there are <strong>two reliable tricks</strong>:</p><p><strong>1. Check the JSON metadata</strong></p><p>Inside the network response, look for: lookupEntityName</p><p><strong>2. Read the ID prefix</strong></p><p>Every Salesforce ID starts with a 3-character object prefix:</p><ul><li>Example: <strong>003XXXXXXXXXXXX</strong></li><li>Prefix <strong>003 = Contact</strong></li></ul><p>(<a href="https://help.salesforce.com/s/articleView?id=000385203&amp;type=1">Use any Salesforce prefix decoder for full mapping</a>)</p><p>If it is not in the list, most likely it is a custom object.</p><h4>Two types of joins you’ll encounter</h4><ol><li><strong>Join to another Salesforce object</strong></li></ol><p>Most lookups reference a standard Salesforce table such as Contact, Account, User, etc. (<strong><em>You’ll recognize these by their Salesforce ID prefixes</em></strong>)</p><pre>select<br>  tt.new_table_t as fk_id,<br>  c.col_name_c,<br>from `{schema}.{dataset}.table_t` tt<br>left join `{schema}.{dataset}.contact` c<br>  on tt.new_table_t = c.id</pre><p><strong>2) Join to a custom table</strong></p><p>Sometimes the lookup points to another custom Salesforce object that has also been ingested into your data warehouse.</p><pre>select<br>  tt.new_table_t as fk_id,<br>  ntt.col_name_c<br>from `{schema}.{dataset}.table_t` tt<br>left join `{schema}.{dataset}.new_table_t` ntt<br> on tt.new_table_t = ntt.id</pre><h4>Example 3 — Multi-level joins</h4><pre># Example table and column<br>Table__t.New_Table__t.Newer_Table__t.Col_name</pre><p>Becomes:</p><pre>select<br>    t.col_name_c<br>from `{schema}.{dataset}.table_t` tt<br>-- Custom object example<br>left join `{schema}.{dataset}.new_table_t` ntt<br>    on tt.new_table_t = ntt.id<br>-- Salesforce object example<br>left join `{schema}.{dataset}.team` t<br>    on ntt.newer_table_t = t.id</pre><h4>Important: exclude deleted records</h4><p>Salesforce reports seem to automatically ignore deleted rows.</p><p>Your SQL should do the same:</p><pre>where is_deleted = false</pre><p>Otherwise counts will not match the dashboard.</p><h3>Speed this up with AI 🤖</h3><p>A practical workflow:</p><ol><li>Copy all within:</li></ol><ul><li>reportMetadata</li><li>reportExtendedMetadata</li></ul><p>2. Paste into Gemini with:</p><blockquote><em>“Convert this Salesforce report JSON into BigQuery SQL with joins and filters.”</em></blockquote><p>3. Validate the result against Salesforce totals.</p><p>AI won’t replace understanding — but it saves hours of manual mapping.</p><h3>Final thoughts</h3><p>With this approach, you can reverse-engineer almost any Salesforce dashboard:</p><ul><li>Even with little to no documentation</li><li>Even years after it was built</li><li>Without admin access</li></ul><p>The same technique can work for other web-based dashboards — if you can read the network payload, you can uncover the truth behind the chart.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb6cebf2e132" width="1" height="1" alt=""><hr><p><a href="https://medium.com/refined-and-refactored/from-salesforce-dashboard-to-sql-a-practical-reverse-engineering-guide-with-the-help-of-gemini-fb6cebf2e132">From Salesforce Dashboard to SQL: A Practical Reverse-Engineering Guide with the Help of Gemini</a> was originally published in <a href="https://medium.com/refined-and-refactored">Joon Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>