+ Start a Discussion
Jonathan PenaJonathan Pena 

I'm trying to create a lightning component that allows me to capture a list of cases that is tied to a particular email address. .

We currently track cases in salesforce.com via our community. However, we do not store any of the consumer's data (Contacts, Accounts) in salesforce. We onlys create the case record along with name and email (Custome fields) of the person submitting the case via community. 

I would like to create a custom lightning component that will allow me to view all related cases based on a particular email. For example, below is a screenshot of a particular  case record in the Service Console,i would like to be able to build a lightning component next to the "Email Us" tab that shows all cases related to this email address. 

Greatly appreciate any guidance you can provide. 

User-added image
AubryAubry
Jonathan,
I may have a solution that will eliminate the need for a custom Lightning Component and save you some time.  Lightning Reports allow filter variables to be passed in the url, meaning you can run a report that filters by Consumer Email, and then put a custom button on the Case object that takes you to the report, passing in the Consumer Email address.

For example, I created the following Lightning Report (I am using "Web Email" instead, since it is a native field):
lightning report, with a filter parameter on Web Email

Next, I created a custom button on the Case Object like so:
custom detail page button, with a url formula of "/lightning/r/Report/00O2R000003yhBiUAI/view?fv0={!Case.SuppliedEmail}"

This button, when clicked from a Case with the SuppliedEmail (aka "Web Email") of "test@test.com", took me to the following report:
a report, showing three cases, each with a Web Email of test@test.com

This may meet your needs, without requiring custom Lightning work.  Just remember to Save the report in a folder that can be accessed by the desired users!