User Activity Report
Last updated
Was this helpful?
Last updated
Was this helpful?
This tutorial guides you through creating a real-time, interactive user activity dashboard in Salesforce using Avonni components. You'll learn how to build a dashboard that lets you:
Select a User: Easily choose a user from a drop-down list using the Combobox component
View Key Metrics: Instantly see key performance indicators (KPIs) for the selected user (e.g., open opportunity value, closed deals).
Visualize Account Locations: Display associated accounts on an interactive map.
See Detailed Data: Explore related information (accounts, contacts, activities) in a dynamic data table.
By the end, you'll have the skills to build similar dynamic reports for various Salesforce use cases.
Open the Avonni Components App: Find and open the "Avonni Components" application from the Salesforce App Launcher.
Create a New Component: Click the New button.
Name the Component: Enter a descriptive name (e.g., "UserActivityReport").
Open the Component Builder: Click Create
We want the Container to be hidden initially and only appear after a user is chosen in the Combobox. Here's how to set that visibility rule:
Select the Container component.
Go to its Visibility settings (usually in the Properties Panel).
Choose the option Show component when all conditions are met (or similar wording like "All Conditions Are Met").
Define the condition: * Base it on the Combobox Component. * Specifically, check its Selected Items
attribute. * Use the operator Is not Empty
.
Why Is not Empty
? Because when no user is selected, the Selected Items
list is empty. When a user is chosen, the list is no longer empty, and the condition becomes true, making the Container visible.
With the metrics in place, we can add other components inside the Container to display more information related to user activity.
For example, let's add a Data Table to show a list of active accounts. We'll define an active account as one with any activity logged in the last 60 days.
To do this:
Add a Data Table component inside the Container.
Configure the Data Table to query the Account
object.
Add a filter to the query: Last Activity
field is equal to LAST 60 DAYS
."
Queries you create in a Dynamic Component aren't limited to a single component. To avoid repetitive setup, you can reuse them across multiple components within the same Dynamic Component. You can also create new queries based on existing ones, tweaking and adapting them quickly.
Ready to see your dynamic component in action? This simple process will allow you to publish your component and add it to any Lightning App or Record Page, making it visible and interactive for your users.
Save your Dynamic Component.
Activate it (using the Activate
button in the Component Builder).
Add to a Page:
Open the Lightning App Builder for the desired App or Record Page.
Find your Dynamic Component under "Custom - Managed" in the component list.
Drag and drop it onto the page.
Configure any page-level properties if needed.
Save and activate the page.
Add the Card: Drag a from the Component Library onto the canvas.
Add the Component: Place a inside the card. This will serve as our User selection dropdown.
Add the below the combobox. This important step highlights a key benefit of Avonni Dynamic Components. We'll use the Container to hold multiple other Avonni components. Setting the visibility on the container itself allows us to control the visibility of all the components contained at once, simplifying management and avoiding repetitive configuration.
The Container component is your secret weapon for controlling the visibility of multiple components at once. Instead of individually, set it on the Container – and all contained components will follow suit! This saves time and simplifies complex layouts.
Inside the first column, add a Metric component. Set the label to 'Open Opportunities'. Configure this metric to display the sum of the Amount
field from the Opportunity
object. Critically, we'll link this metric to the Combobox from : the metric will automatically filter its results based on the User ID selected in the Combobox.
The power of Avonni Dynamic Components lies in this easy linking of component properties. You can create that automatically update based on user selections and other dynamic filters.
This tutorial requires installing on your Salesforce org.