Report Table

As of today, Lightning supports only charts instead of raw data when dealing with reports. GridMate bridges this gap by providing a component to display a report table on any Lightning page (Home, App, Record).

In this tutorial, we will setup an Opportunity report to visualize the pipeline by account on the homepage. Below is a quick demo on how to configure and use the GM - Report Table component on a homepage. With this report on the homepage, the user can see the data and not only a chart!

If the component is used on a record page, the report can be filtered on the current record Id using Filter property.

Below is an example to filter opportunities report based on the current account.

{ "ACCOUNT_ID": { "value": "$recordId" } }

👋 Note that Salesforce Reports doesn't always use the field API name for filtering. You can find the field name to use by following the instructions below.

Execute the code bellow using the Executing Anonymous Apex Code 👇

Report r = [
    SELECT Id, Name, DeveloperName
    FROM Report
    WHERE DeveloperName = ${Developer_Name}
    Limit 1
];

Reports.ReportMetadata reportMetadata = Reports.ReportManager.describeReport(r.Id).getReportMetadata();

System.debug(JSON.serialize(reportMetadata));

In our example Developer Name = 'Closed_Opportunities_ode'

For better vision, copy the JSON log into the GridMate playground and you will find the columns on the reportFilters attribute.

Last updated