{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":5248,"path":"conversational-interfaces/virtual-agent/va-geolocation.md","title":"Using geolocation in Virtual Agent","bundle":null,"doc_type":null,"release":"australia","body":"\n# Using geolocation in Virtual Agent\n\nTopic authors can include a pre-built topic block called Geolocation in conversations with users. The Geolocation topic block retrieves the latitude and longitude coordinates of the user's location.\n\nTopic authors can add this topic block to larger conversation flows. With the user's permission, the topic block retrieves the user's latitude and longitude location coordinates. Knowing these coordinates can help topic authors respond to customer requests or issues faster and more efficiently.\n\nFor example, you may need to send a technician to a customer site to resolve an incident. To quickly respond to the customer, you need to know which technicians are located nearby so you can dispatch the appropriate technician for the customer's location.\n\nFor general information about how geolocation is used on the ServiceNow platform, see [Geolocation](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/c_Geolocation.md).\n\n## Share location details\n\nThe first time a user, such as a field technician, uses the Geolocation topic block in a conversation, they are asked if they would like to share details about their location.\n\n\\[Omitted image \"va-geolocation-approval.png\"\\] Alt text: The chatbot asks, \"Would you like to share your location?\" Choices are No and Yes.\n\n<table id=\"table_epl_33n_xrb\"><thead><tr><th>\n\nUser choice\n\n</th><th>\n\nTopic block response\n\n</th></tr></thead><tbody><tr><td>\n\nYes\n\n</td><td>\n\nThe topic block sends the user's latitude and longitude coordinates from the server to the user's device.If users want to allow the ServiceNow instance to access their location, users may then see operating system-specific or browser-specific prompts. Examples of such prompts include the following:\n\n-   Allow \\(always\\)\n-   Allow \\(one time only\\)\n-   Block \\(don't allow\\)\n\n Depending on the user's response, they may see this prompt one or more times, or they may never see it.\n\n</td></tr><tr><td>\n\nNo\n\n</td><td>\n\nThe topic block does not retrieve user coordinates and displays a relevant error message for the topic author to resolve. The error is logged as an output parameter. For details, see [Geolocation topic block parameters](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/conversational-interfaces/virtual-agent/va-platform-topicblocks.md).\n\n</td></tr></tbody>\n</table>## Modify the Geolocation topic block\n\nIf you are a topic author or an admin, you can modify the Geolocation topic block flow, as applicable. Simply duplicate the topic block and rename it. You can then use it as needed in the larger conversation flow you're designing.\n\nThe Geolocation topic block properties sheet lets topic authors specify the input and output mappings. You can also customize the prompt using data pills or scripts. For example, you can include an explanation or reason for asking the question. For information about using data pills and scripts, see [Assistant Designer controls](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/conversational-interfaces/virtual-agent/virtual-agent-controls.md).\n\n\\[Omitted image \"va-geolocation-user-prompt.png\"\\] Alt text: The value of the permissionPrompt string is \"Would you like to share your location?\"\n\nUse the input mappings to customize how Virtual Agent asks users for permission to share their location. The response is passed to the topic block.\n\nUse the output mappings to specify the variables that are returned from the topic block in the conversation.\n\n\\[Omitted image \"va-geolocation-output-parameters.png\"\\] Alt text: Geolocation output mapping parameters include latitude, longitude, errormessage, errortype, and status.\n\nAll the variables are selected by default. Keep the default choices, or select the variables you want returned from the topic block. At a minimum, you should select the latitude and longitude coordinates. However, error messages, error type, and status details could be useful when resolving problems. The output mappings you select are stored as variables on the server.\n\n\\[Omitted image \"va-geolocation-results.png\"\\] Alt text: Geolocation topic block results read, \"This is what I got back,\" followed by the latitude and longitude, an OK status, and no error.\n\nFor more information about the Geolocation topic block properties, see [Geolocation topic block parameters](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/conversational-interfaces/virtual-agent/va-platform-topicblocks.md).\n\n"}}