{"title":"Database.ImportData(Boolean, var Text [, Boolean] [, Boolean] [, Record]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/database/database-importdata-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/database/database-importdata-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/database/database-importdata-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Imports data from a file that has been exported from a database.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Database.ImportData(Boolean, var Text [, Boolean] [, Boolean] [, Record]) Method","slug":"databaseimportdataboolean-var-text-boolean-boolean-record-method","at":0,"chars":1911},{"level":2,"title":"Syntax","slug":"syntax","at":280,"chars":259},{"level":2,"title":"Parameters","slug":"parameters","at":539,"chars":998},{"level":2,"title":"Return Value","slug":"return-value","at":1537,"chars":238},{"level":2,"title":"Related information","slug":"related-information","at":1775,"chars":136}],"text":"# Database.ImportData(Boolean, var Text [, Boolean] [, Boolean] [, Record]) Method\n> Version: _Available or changed with runtime version 1.0._\nImports data from a file that has been exported from a database.\n> NOTE\n> This method is supported only in Business Central on-premises.\n## Syntax\n```al\n[Ok := ]  Database.ImportData(ShowDialog: Boolean, var FileName: Text [, IncludeApplicationData: Boolean] [, IncludeGlobalData: Boolean] [, CompanyRecord: Record])\n```\n> NOTE\n> This method can be invoked without specifying the data type name.\n## Parameters\nShowDialog\nType: ../boolean/boolean-data-type\nSpecifies if you want to display a dialog box where the user can confirm the action.\nFileName\nType: ../text/text-data-type\nSpecifies the name and location of the file that must be imported. The file must have been exported from a database\n.\n*[Optional] IncludeApplicationData*\nType: ../boolean/boolean-data-type\nSpecifies if you want to import the data that defines the application in the database. This includes the permissions, permission sets, profiles, and style sheets.\nCreate a variable of type Boolean to specify this parameter.\nTo import application objects, you must use the Import-NAVData Windows PowerShell cmdlet.\n*[Optional] IncludeGlobalData*\nType: ../boolean/boolean-data-type\nSpecifies if you want to import global, non-company specific data.\nCreate a variable of type Boolean to specify this parameter.\n*[Optional] CompanyRecord*\nType: ../record/record-data-type\nSpecifies the company or companies that must be imported.\n## Return Value\n*[Optional] Ok*\nType: ../boolean/boolean-data-type\ntrue if the operation was successful; otherwise false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.\n## Related information\ndatabase-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}