--- title: Embedding reports in Jelly description: You can embed reports in any Jelly-based element, such as a UI page.When embedding a report in a Jelly element, you can define a report at any time by passing parameters. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/now-intelligence/reporting/c\_EmbeddingReportsInJelly.html release: australia product: Reporting classification: reporting topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 14 breadcrumb: [Advanced Core UI reporting topics, Reporting, Reporting, dashboards, and Performance Analytics in the Core UI, Platform Analytics] --- # Embedding reports in Jelly You can embed reports in any Jelly-based element, such as a UI page. ## Enabling Embedding To enable embedding reports in Jelly, add the following element to your Jelly code. `` After adding this code, you can embed an existing report, or generate a report within the Jelly code. ## Embedding an existing report You can embed an existing report by calling the `embedReportById(targetSpan, reportId)` function. For example, add the following to the HTML/XML block in the UI page record: ```
``` And add the following to the Client script block in the UI page record. Replace <report sys\_id> with the report's actual sys\_id: ``` var div = $j("#report_stuff"); embedReportById(div, <"report sys_id">); ``` Alternatively, you can embed the JavaScript in the jelly code entirely in the HTML/XML block. Add the code from the client script block between <script> tags: ```
``` |Parameter|Description| |---------|-----------| |targetSpan|The jQuery element to embed the chart in. The chart uses the size of this element.| |reportId|The sys\_id of the report you want to embed.| ## Generate and embed a report You can embed a report within the UI by calling the `embedReportByParams(targetSpan, parms)` function. When embedding a report in this way, you can generate a new report using parameters, or specify a report sys\_id to display that report. For example, add the following to the HTML/XML block in the UI page record: ```
``` And add the following to the Client script block in the UI page record: ``` var params = {sysparm_title: "Average for all ratings", sysparm_field: "category", sysparm_type: "bar", sysparm_table: "asmt_category_result", sysparm_aggregate: "AVG", sysparm_sumfield: "rating"}; var div = $j("#report_stuff"); embedReportByParams(div, params); ``` Alternatively, you can embed the JavaScript inside the jelly code. Add the code from the client script block between <script> tags: ```
``` |Parameter|Description| |---------|-----------| |targetSpan|The jQuery element to embed the chart in.| |parms|A JSON object defining the report. Available parameters depend on the report type.| ## Generating and embedding a list report When you embed an existing list report or generate a list report and embed it, you must enter one more line of code. Add the following to the HTML/XML block in the UI page record: ```
``` Add the following to the Client script block in the UI page record. Replace <report sys\_id> with the report's actual sys\_id: ``` var div = $j("#report_stuff"); embedReportById(div, <"report sys_id">); ``` Or embed the JavaScript in the jelly code entirely in the HTML/XML block. Add the code from the client script block between <script> tags: ```
``` |Parameter|Description| |---------|-----------| |targetSpan|The jQuery element to embed the chart in. The chart uses the size of this element.| |reportId|The sys\_id of the report you want to embed.| **Parent Topic:**[Advanced Core UI reporting topics](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/now-intelligence/reporting/c_AdvancedReporting.md) ## Embedded report parameters When embedding a report in a Jelly element, you can define a report at any time by passing parameters. ### Common parameters Certain parameters are used by multiple report types.
Parameter Description Default value
jvar\_report\_id The sys\_id of a report record. If you pass this parameter, do not specify any other parameters. All values are taken from the report record.  
sysparm\_report\_id Use this parameter instead of jvar\_report\_id when you want to override any of the other sysparm parameters that exist in the report.  
sysparm\_title The title of the report.  
sysparm\_table The table to report on. Specify this value or sysparm\_report\_source\_id, but not both.  
sysparm\_report\_source\_id The sys\_id of a report source. Specify this value or sysparm\_table, but not both. This value is used instead of sysparm\_table if you pass both.  
sysparm\_type The type of report to create. Possible values: list, line, line\_bar, area, spline, bar, horizontal\_bar, pareto, hist, pie, donut, semi\_donut, speedometer, dial, pivot, pivot\_v2, funnel, calendar, pyramid, box, trend, control, trendbox, and heat map. line
sysparm\_field The field from the specified table to group data by. Required for time series, column, bar, pie, donut, funnel, pyramid, box, trend, and trendbox reports. Optional for list reports.  
sysparm\_query The filter to apply to the data before generating the report. Specify a query string for this value. To sort your query results by a specific field, add `^ORDERBY` or `^ORDERBYDES` to the end of the query string. ORDERBY sorts the query by ascending order. ORDERBYDES sorts the query by descending order.  
sysparm\_aggregate The aggregation type.Possible values: AVG, COUNT, SUM, and COUNT\_DISTINCT COUNT
sysparm\_sumfield The field to aggregate data on. This parameter does not apply when using a COUNT aggregation type.  
sysparm\_display\_grid A true/false value that controls whether the report displays a data grid. false
sysparm\_show\_other A true/false value that controls whether the Other group appears on the report. This group appears only if the number of groups exceeds the number specified in the sysparm\_others parameter. This parameter applies to bar, pie, funnel, pyramid, pivot, and heat map reports. true
sysparm\_others The maximum number of individual groups of data to display. Any additional data groups are combined into the Other group. This parameter applies to bar, pie, funnel, pyramid, pivot, and heat map reports.  
sysparm\_source\_type The source of the embedded report. Optional.Possible values: table, metricbase, source, import table
sysparm\_set\_color The color setting for the report.Possible values: one\_color, color\_palette, several\_colors color\_palette
sysparm\_color\_palette The color palette that the report uses. This parameter is used when sysparm\_set\_color="color\_palette".Possible value: The sys\_id of a color palette Default UI14
sysparm\_color The color that the report uses. This parameter is used when sysparm\_set\_color="one\_color".Possible value: The sys\_id of a color  
sysparm\_chart\_colors The set of chart colors that the report uses. This parameter is used when sysparm\_set\_color="several\_colors".Possible value: A comma-separated list of color hex codes  
sysparm\_show\_marker A marker is the value represented by a dot in a line or another graphic element in a chart. This parameter is a true/false value that controls whether the marker appears. true
sysparm\_show\_empty A true/false value that controls if records with empty grouping or trend values appear on the report. false
sysparm\_stack\_field The field used to control stacking on bar and column reports.  
sysparm\_bar\_unstack A true/false value that controls if stacked data is presented as a single bar or column, or as multiple bars. false
sysparm\_box\_field The numeric field used to measure the data. This parameter is required for box and histogram reports.  
sysparm\_trend\_field The date-time field used to organize trend data. This parameter is required for time series, trend, and box reports.  
sysparm\_trend\_interval The interval to measure trend values by. Possible values: year, quarter, month, week, dayofweek, hour, and date. year
sysparm\_compute\_percent The value to use when displaying report percentages. You can display percentages based on the total record count, or by the specified aggregate.Possible values: aggregate and count count
sysparm\_funnel\_neck\_percent A number 1–100 that defines the percentage of a funnel report that is the neck of the funnel. 30
sysparm\_show\_chart\_data\_label A true/false value that controls if data labels appear on the report. false
sysparm\_show\_zero A true/false value that controls if zeroes appear on multilevel pivot and heat map reports.  
sysparm\_ct\_row The field used to define the rows in heat map and bubble reports.  
sysparm\_ct\_column The field used to define the columns in heat map and bubble reports.  
sysparm\_y\_axis\_category\_fields The field used to define the rows in multilevel pivot reports. Specify up to five comma-separated field names.  
sysparm\_x\_axis\_category\_fields The field used to define the columns in multilevel pivot reports. Specify up to three comma-separated field names.  
sysparm\_list\_ui\_view The sys\_id of a list view to use when a user drills into the report.  
sysparm\_show\_marker A true/false value that controls if markers appear at every plotted point on a report. true
sysparm\_apply\_alias A true/false value that controls if configured aliases appear in embedded reports.  
### Service catalog parameters Certain parameters apply only to reports created on service catalog tables, such as the Requested Item \[sc\_req\_item\] table. These parameters are not available on list or calendar type reports. |Parameter|Description| |---------|-----------| |sysparm\_sc\_groupby\_item\_id|The sys\_id of a catalog item. Use this parameter with the **sysparm\_sc\_groupby\_variable\_id** parameter to group a service catalog report based on a catalog variable value. These parameters replace the**sysparm\_field** parameter when grouping on service catalog variables.| |sysparm\_sc\_groupby\_variable\_id|The sys\_id of the catalog item variable used to determine how data is grouped on the report. This variable must belong to the catalog item specified in the **sysparm\_sc\_groupby\_item\_id**parameter.| |sysparm\_sc\_stackby\_item\_id|The sys\_id of a catalog item. Use this parameter with the**sysparm\_sc\_stackby\_variable\_id** parameter to stack a service catalog report based on a catalog variable value. These parameters replace the **sysparm\_stack\_field** parameter when grouping on service catalog variables. Only reports that support stacking, such as bar reports, support these parameters.| |sysparm\_sc\_stackby\_variable\_id|The sys\_id of the catalog item variable used to determine how data is grouped on the report. This variable must belong to the catalog item specified in the **sysparm\_sc\_stackby\_item\_id**parameter.| ### MetricBase parameters To use MetricBase in an embedded report, the sysparm\_source\_type parameter must be set to "metricbase". MetricBase also requires the sysparm\_custom\_configuration parameter, which has the following syntax: ``` sysparm_custom_config: "{query_condition:\"\",transforms:[{transform:{transform:\"Reference\",name:\"chart-subjects\"},metric:\"mb_metricname\"}], group_by:\"\", table:\"mb_tablename\"}"; ``` In this syntax: - A `transform` is a chain of nested transform functions. The last transform of every chain must always be the Reference transform: ``` {transform:\"Reference\",name:\"chart-subjects\"} ``` - A `metric` is a metric field of a metric table. - The `group-by` field is the field on the selected metric table by which the time series is grouped. - `table` refers to the metric table - `mb_...` are placeholder names All attributes are required except for `group-by`. ### Chart-specific parameters Certain parameters are available only for specific report types. |Parameter|Description|Default value| |---------|-----------|-------------| |sysparm\_show\_chart\_total|A true/false value that controls if the total score of the grouped donut appears in the center of the report.|false| |sysparm\_donut\_width\_percent|A number 1–100 that controls the thickness of the donut report.|50| |Parameter|Description|Default value| |---------|-----------|-------------| |sysparm\_use\_color\_heatmap|A true/false value that controls if the heatmap uses a gradient to color the report. When true, the sysparm\_axis\_max\_color and sysparm\_axis\_min\_color values are used.|true| |sysparm\_axis\_max\_color|The color used in the heatmap gradient to indicate a high value. This value must be the sys\_id of a Color Definition \[sys\_report\_color\] record.|UI14 blue| |sysparm\_axis\_min\_color|The color used in the heatmap gradient to indicate a low value. This value must be the sys\_id of a Color Definition \[sys\_report\_color\] record.|white|
Parameter Description Default value
sysparm\_gauge\_autoscale A true/false value that controls if the dial automatically calculates the minimum and maximum scale on the report. If you set this value to false, you must specify a sysparm\_from and sysparm\_to value. true
sysparm\_from A number that defines the minimum value for the axis scale.  
sysparm\_to A number that defines the maximum value for the axis scale.  
sysparm\_upper\_limit A number that defines the upper threshold for the dial. If you do not specify a value, the dial has no upper threshold.  
sysparm\_lower\_limit A number that defines the lower threshold for the dial. If you do not specify a value, the dial has no lower threshold.  
sysparm\_direction A value that controls which values are considered positive on the report, lower values or higher values. Possible values: minimize and maximize. minimize
### Chart size parameters Certain parameters control the width and height of the report. |Parameter|Description|Default value| |---------|-----------|-------------| |sysparm\_chart\_size|The size of the chart in the report. Valid values are small, medium, and large.|large| |sysparm\_custom\_chart\_size|Enable this parameter to specify custom chart height and width values instead of using a size option from the **sysparm\_chart\_size** parameter.|false| |sysparm\_custom\_chart\_height|The height of the chart in the report, in pixels.| | |sysparm\_custom\_chart\_width|The width of the chart in the report, in pixels.| | ### Chart title parameters Certain parameters are available only for reports that display a title. These report types include time series, bar, column, pie, donut, dials, trend, box, trend box, histogram, pyramid, heat map, funnel, and control reports.
Parameter Description Default value
sysparm\_report\_title\_size A number that defines the font size of the title. 16
sysparm\_report\_title\_color The title text color. This value must be the sys\_id of a Color Definition \[sys\_report\_color\] record. black
sysparm\_title\_horizontal\_alignment Where the title is placed horizontally relative to the report. This value is used only if sysparm\_custom\_report\_title\_position is false.Possible values are: left, center, and right. center
sysparm\_title\_vertical\_alignment Where the title is placed vertically relative to the report. This value is used only if sysparm\_custom\_report\_title\_position is false.Possible values: top, middle, and bottom. top
sysparm\_custom\_report\_title\_position A true/false value that controls whether the x and y coordinates define the report title position instead of relative alignment. false
sysparm\_report\_title\_x\_position A number that defines the x position of the title on the report. This value is used only if sysparm\_custom\_report\_title\_position is true. 0
sysparm\_report\_title\_y\_position A number that defines the y position of the title on the report. This value is used only if sysparm\_custom\_report\_title\_position is true. 0
### Chart border parameters Certain parameters are available only for reports that display a border. These report types include: time series, bar, column, pies, donuts, dials, trend, box, trend box, histogram, pyramid, heat map, funnel, and control reports. |Parameter|Description|Default value| |---------|-----------|-------------| |sysparm\_show\_report\_border|A true/false value that controls whether the report displays a border.|false| |sysparm\_report\_border\_width|A number that defines the width of the border, in pixels.|1| |sysparm\_report\_border\_radius|A number that defines the radius size of the corners of the border, in pixels.|0| ### Legend parameters Certain parameters are available only for reports that display a legend. These report types include pie, donut, stacked bar, stacked column, time series, trend, box, histogram, pyramid, control, and heat map reports.
Parameter Description Default value
sysparm\_show\_legend A true/false value that controls whether the report displays a legend. true
sysparm\_legend\_horizontal\_alignment Where the legend is placed horizontally relative to the report.Possible values: left, center, and right. center
sysparm\_legend\_vertical\_alignment Where the legend is placed vertically relative to the report.Possible values: top, middle, and bottom. bottom
sysparm\_show\_legend\_border A true/false value that controls whether the legend displays a border. true
sysparm\_legend\_border\_width A number that defines the width of the legend border, in pixels. 1
sysparm\_legend\_border\_radius A number that defines the radius size of the corners of the legend border, in pixels. 0
### X-axis parameters Certain parameters are available only for reports that use an X axis. These report types include bar, horizontal bar, pareto, column, line area, spline, box, trendbox, control, and trend reports. |Parameter|Description|Default value| |---------|-----------|-------------| |sysparm\_x\_axis\_title|The name to display on the x axis.| | |sysparm\_x\_axis\_title\_size|A number that defines the font size of the x-axis title.| | |sysparm\_x\_axis\_title\_bold|A true/false value that controls whether the x-axis title text is bold.|true| |sysparm\_x\_axis\_opposite|A true/false value that controls if the x axis appears at the top of the report.|false| |sysparm\_x\_axis\_display\_grid|A true/false value that controls if vertical grid lines appear from the x axis.|false| |sysparm\_x\_axis\_grid\_dotted|A true/false value that controls whether the vertical grid lines are dotted.|false| |sysparm\_x\_axis\_label\_size|A number that defines the font size for increment labels on the x axis.|11| |sysparm\_x\_axis\_label\_bold|A true/false value that controls whether the x-axis increment labels are bold.|false| ### Y-axis parameters Certain parameters are available only for reports that use a Y axis. These report types include bar, horizontal bar, Pareto, column, line area, spline, box, trendbox, control, and trend reports. |Parameter|Description|Default value| |---------|-----------|-------------| |sysparm\_y\_axis\_title|The name to display on the y axis.|An automatically generated description of the report aggregation| |sysparm\_y\_axis\_title\_size|A number that defines the font size of the y-axis title.| | |sysparm\_y\_axis\_title\_bold|A true/false value that controls whether the y-axis title text is bold.|true| |sysparm\_y\_axis\_opposite|A true/false value that controls if the y axis appears on the left of the report.|false| |sysparm\_y\_axis\_display\_grid|A true/false value that controls if horizontal grid lines appear from the y axis.|true| |sysparm\_y\_axis\_grid\_dotted|A true/false value that controls whether the horizontal grid lines are dotted.|false| |sysparm\_y\_axis\_label\_size|A number that defines the font size for increment labels on the y axis.|12| |sysparm\_y\_axis\_label\_bold|A true/false value that controls whether the y-axis increment labels are bold.|false| |sysparm\_y\_axis\_from|A number defining the lowest value displayed on the y axis.| | |sysparm\_y\_axis\_to|A number defining the highest value displayed on the y axis.| |