{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":38452,"path":"platform-administration/c_EnablingLinksToServiceNowRecords.md","title":"Links to records in email notifications","bundle":null,"doc_type":null,"release":"australia","body":"\n# Links to records in email notifications\n\nAdding the **$\\{URI\\}** parameter to an outbound email body or template creates a link to a specific record.\n\nWhen a user clicks the word LINK, the instance prompts the user to log in if not already logged in, and then redirects the user to the record specified in the URI.\n\n\\[Omitted image \"EmailURI.png\"\\] Alt text:\n\nThe $\\{URI\\} parameter has an extension called the $\\{URI+\\} format to specify additional arguments in the email link, such as sysparm terms, in addition to the automatically created URI. For example \\(whitespace added for improved readability\\):\n\n```\n${URI+&sysparm_scriptlet=current.assigned_to=gs.getUserID()\n&sysparm_scriptlet_condition=current.assigned_to.nil()\n&sysparm_view=incident_active}\n```\n\nThis example executes the JavaScript:\n\n```\ncurrent.assigned_to=gs.getUserID()\n```\n\nwhen the condition of\n\n```\ncurrent.assigned_to.nil()\n```\n\nis satisfied. Additionally, the script sets the view to `incident_active`.\n\n## Linking to a record in Workspace\n\nThe `${URI}` and `${URI_REF}` variables don't apply to records in Workspace. To link to a record in Workspace, create a mail script and reference it in your notification. For more information on using mail scripts, see .\n\nThe mail script that you create should print a URL to the notification. The URL must have the following format:\n\n```\nhttps://<instance_name>/now/workspace/<workspace_name>/record/<table_name>/<sys_id>\n```\n\nThe following example script shows the logic that a mail script must include to create a link to a record in Workspace.\n\n```\n// Dynamically construct an Agent Workspace URL and insert a link in the notification\n  var agentURL = '<a href=\"' + gs.getProperty('glide.servlet.uri') + '/now/workspace/agent/record/'+ current.getTableName() + '/' + current.sys_id + '\">' + current.number + '</a>';\n  template.print(agentURL + \"<br />\");\n```\n\n-   **[Enable links to records](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/c_EnableLinksToServiceNowRecords.md)**  \nAdding the special **$\\{URI\\}** parameter to an outbound email body or template creates a link to a specific record.\n-   **[Change the link text](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/c_ChangeTheLinkText.md)**  \nTo show the display value of the record as the link text instead of the word LINK, use the $\\{URI\\_REF\\} parameter instead of the $\\{URI\\} parameter.\n-   **[Link to related records](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/c_LinkToRelatedRecords.md)**  \nA notification can link to a related record by specifying a reference field in front of the**$\\{URI\\}** or **$\\{URI\\_REF\\}** parameters.\n-   **[Content page links in email notifications](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/c_LinkingToContentPages.md)**  \nLinks to CMS pages can be put in notifications to make it easy for the reader to access the pages.\n\n**Parent Topic:**[Create an email notification](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-administration/t_CreateANotification.md)\n\n"}}