Background
A Solarwinds Application monitor contains one or more Components that gather performance data and evaluate it against a set of thresholds and/or other criteria. If one or more Components breaches a threshold, fails to respond, or otherwise fails to satisfy criteria, its status changes from OK to Warning/Critical/Down/etc. In turn, the Application monitor's status changes from OK to Warning/Critical/Down/etc.
Solarwinds Application alerts support several macros that list the components of an application (all Components, or just Components that are not OK):
${N=SwisEntity;M=ApplicationAlert.ComponentsWithProblems}
${N=SwisEntity;M=ApplicationAlert.ComponentsWithProblemsFormatted}
${N=SwisEntity;M=ApplicationAlert.ComponentsWithProblemsFormattedHtml}
${N=SwisEntity;M=ApplicationAlert.ComponentsWithStatus}
${N=SwisEntity;M=ApplicationAlert.ComponentsWithStatusFormatted}
${N=SwisEntity;M=ApplicationAlert.ComponentsWithStatusFormattedHtml}
These macros produce a listing like this:

These are useful when troubleshooting application performance, and it allows all Component alerts for an Application monitor to be bundled into a single Application alert. However, these macros do not show the current value or statistic of the components.
I've developed several custom SQL functions that list Components with their status and either their current statistic (for components that report a statistic) or response time (for components that don't report a statistic). The custom scripts produce a listing like this:

Scripts to create the SQL Server custom functions are attached. The scripts do not change any delivered Solarwinds functions, stored procedures, or data.
Instructions
- In a SQL Server query window, open and run all three scripts.
- In your Solarwinds Application alert definition, place one of the following macros where you want to see the list of application components.
- All Components of the Application
${SQL: SELECT [dbo].[Custom_apm_GetApplicationComponentsValueStatusAll] (${N=SwisEntity;M=ApplicationID}, 1)}- Only Components with problems (status is not OK, Unmanaged, or Unknown)
${SQL: SELECT [dbo].[Custom_apm_GetApplicationComponentsValueStatusProblems] (${N=SwisEntity;M=ApplicationID}, 1)}