Dynamic Filter In Lightning Reports

In this article I will show you how can you link two reports. Passing parameters from one report to another report. Lets start :

I will build a simple report so that it will be easy to understand.

Before creating report the first thing I will do is to create a new formula field on Account object.

Field Name : TempAccountName

Formula : HYPERLINK('https:/Your org/lightning/r/report/your reportID/view?fv0='+Name, Name, '_self')

Note : Group fields by the formula field we have added (TempAccountName ). And fv0 is the parameter. You can add multiple parameters by adding &fv0, &fv1, &fv2 and so on.

Report 1 : Here's my first report "Group Demo" which will list the record count with group by Account name. See below image:

In this report when someone click on Account name it will redirect to another report filtering the records only by Account name.

Report 2 : Detailed report which will show all the detail records by Account Name.

Next step is to add a filter. Go to Filters tab - > Add Filter for Account name as shown in below image and Save the report.

Now run the first report click on an account name and see the output. For example :

Click on "Demo Account".

This is how we pass parameters to the report.