{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":27496,"path":"it-business-management/project-management/portal-board-widget-form.md","title":"Portal board widget form","bundle":null,"doc_type":null,"release":"australia","body":"\n# Portal board widget form\n\nLearn about the fields of portal board widget form.\n\n<table id=\"table_oc2_3zk_xcb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nUnique name for the widget you are configuring.\n\n</td></tr><tr><td>\n\nOrder\n\n</td><td>\n\nThe order in which your widgets appear on both your Investment Board and the Investment Portal page. Lower numbers are placed ahead of higher numbers.\n\n For example, a widget with an order set to 100 appears before a widget with an order set to 200.\n\n</td></tr><tr><td>\n\nAggregate type\n\n</td><td>\n\nType of aggregation applied for the investment widget calculation: **Sum**, **Average**, **Minimum**, **Maximum**, and **Count**.For example, you are aggregating the actual cost of three projects, A, B, and C, surfaced by a filter. Actual costs are 1000 for project A, 2000 for project B, and 3000 for project C.\n\n If sum is selected as the aggregate type, then the actual cost metric value would be 6000. If average is selected as the aggregate type, then the actual cost metric value would be 2000. If minimum is selected as the aggregate type, then the actual cost metric value would be 1000. If maximum is selected as the aggregate type, then the actual cost metric value would be 3000. If count is selected as the aggregate type, then the actual cost metric value would be 3.\n\n</td></tr><tr><td>\n\nScripted\n\n</td><td>\n\nCheck box to specify a script for the investment widget calculation.\n\n</td></tr><tr><td>\n\nShow Label\n\n</td><td>\n\nCheck box to display either the label or the color indicator.If you clear the check box, the **Color** field displays, which allows you to set the color.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nCheck box to indicate that the investment widget is active.\n\n</td></tr><tr><td>\n\nDisplay on board\n\n</td><td>\n\nCheck box to display the investment widget on your investment board.\n\n</td></tr><tr><td>\n\nParent widget\n\n</td><td>\n\nParent widget for this investment metric widget. A parent widget can have up to a maximum of three child widgets.\n\n</td></tr><tr><td>\n\nInclude by default\n\n</td><td>\n\nCheck box to show an active investment widget by default on:-   new boards\n-   existing boards that do not have widget selection configured\n\nThe check box is selected by default.For more information on configuring widgets on an investment board, see [Widget Configuration](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-business-management/ppm-collaboration/use-investment-portal.md).\n\n</td></tr><tr><td>\n\nShort description\n\n</td><td>\n\nBrief description about the investment widget.\n\n</td></tr><tr><td>\n\nScript\n\n</td><td>\n\nScript written for the dynamic calculation of investment widget. This field is displayed only when the **Scripted** check box is selected. The following script returns a string containing the desired output to be displayed on widget. Five variables \\(which are programmatically introduced to the script\\) are available:\n\n -   projectFilter: Project filter of Investment Portal board.\n-   demandFilter: Demand filter of Investment Portal board.\n-   projectClass: Project class of Investment Portal board which is used during teamspaces value evaluation. It returns tsp1\\_project for Teamspace1 Portal Board.\n-   demandClass: Demand class of Investment Portal board which is used during teamspaces value evaluation. It returns tsp1\\_demand for Teamspace1 Portal Board.\n-   boardSysId: SysId of Investment Portal board. It provides access to more information on Investment Portal board when needed.\n\n **Sample scripted widget for project cost** ```\ntotalProjectCost();\n\nfunction totalProjectCost() \n{\n    var totalCost = 0;\n    \n    if(!JSUtil.nil(projectClass) && !JSUtil.nil(projectFilter))\n{ \n        var projectGa = new GlideAggregate(projectClass);\n        projectGa.addEncodedQuery(projectFilter);\n        projectGa.setGroup(false);\n        projectGa.addAggregate('SUM', 'cost');\n\n        projectGa.query();\n\n        if(projectGa.next()) \n{\n            if(projectGa.getAggregate('SUM', 'cost'))\n            totalCost += parseFloat(projectGa.getAggregate('SUM', 'cost'));\n        }\n    }\n    return PPMCurrencyHelper.defaultCurrencySymbol() + PPMCurrencyHelper.getFormattedAmount(totalCost);\n}\n```\n\n</td></tr></tbody>\n</table>|Field|Description|\n|-----|-----------|\n|Project aggregate column|Aggregation is applied on the selected column of the Project \\[pm\\_project\\] table.|\n|Project table|Table from which projects are being filtered.|\n|Project filter|Criteria applied to filter projects from the Project table.|\n\n|Field|Description|\n|-----|-----------|\n|Demand aggregate column|Aggregation is applied on the selected column of the Demand \\[dmn\\_demand\\] table.|\n|Demand table|Table from which demands are being filtered.|\n|Demand filter|Criteria applied to filter demands from the Demand table.|\n\n**Related topics**  \n\n\n[Configure your investment metrics as widgets](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-business-management/ppm-collaboration/configure-investment-metrics.md)\n\n"}}