{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":26711,"path":"it-business-management/demand-management/widget-form.md","title":"Widget form","bundle":null,"doc_type":null,"release":"australia","body":"\n# Widget form\n\nUse the widget form to configure a new widget.\n\n<table id=\"table_osc_b4b_xvc\"><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.\n\n</td></tr><tr><td>\n\nScripted\n\n</td><td>\n\nOption for indicating the value on the widget is from a code script.By default, this option is selected and is read-only.\n\n</td></tr><tr><td>\n\nShow Label\n\n</td><td>\n\nOption for displaying either the label or the color indicator.If you clear the check box, the **Color** field appears and you can set the color.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nOption for indicating the status of the widget.Only active widgets are shown on the Demand Financials page.\n\n</td></tr><tr><td>\n\nParent widget\n\n</td><td>\n\nWidget that is the parent of the current widget.The current widget displays in the Child widgets related list of the selected widget.\n\n You can add a maximum of three child widgets for a parent widget.\n\n</td></tr><tr><td>\n\nFormatter required\n\n</td><td>\n\nOption for specifying whether a currency formatter is required for the widget.\n\n</td></tr><tr><td>\n\nScript\n\n</td><td>\n\nCode script that returns a requested metric value that is displayed on the widget.\n\n In the script, use the context and filter objects. The context object contains all the demand financial fields, such as total\\_costs, irr\\_value, and capital\\_budget.\n\n The following sample script returns the capital budget metric value of a demand to appear on the widget.\n\n ```\nvar context = JSON.parse(context);\nvar filter = context.filters;\n\nvar now_GR = new GlideRecord('dmn_demand');\ngr.addEncodedQuery(filter['dmn_demand']);\ngr.query();\nif(gr.next())\n\tgr.getValue('capital_budget');\nCollapse\n```\n\n</td></tr><tr><td>\n\nShort description\n\n</td><td>\n\nDescription of the widget.\n\n</td></tr></tbody>\n</table>**Parent Topic:**[Demand Management forms](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-business-management/demand-management/demand-management-forms.md)\n\n"}}