{"title":"Xmlport.Import(Integer, var InStream [, var Record]) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/xmlport/xmlport-import-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/xmlport/xmlport-import-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/xmlport/xmlport-import-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":"Reads and parses an incoming XML data stream (XML document).","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Xmlport.Import(Integer, var InStream [, var Record]) Method","slug":"xmlportimportinteger-var-instream-var-record-method","at":0,"chars":1363},{"level":2,"title":"Syntax","slug":"syntax","at":183,"chars":109},{"level":2,"title":"Parameters","slug":"parameters","at":292,"chars":698},{"level":2,"title":"Return Value","slug":"return-value","at":990,"chars":238},{"level":2,"title":"Related information","slug":"related-information","at":1228,"chars":135}],"text":"# Xmlport.Import(Integer, var InStream [, var Record]) Method\n> Version: _Available or changed with runtime version 1.0._\nReads and parses an incoming XML data stream (XML document).\n## Syntax\n```al\n[Ok := ]  Xmlport.Import(Number: Integer, var InStream: InStream [, var Record: Record])\n```\n## Parameters\nNumber\nType: ../integer/integer-data-type\nThe ID of the XmlPort that you want to run. If the XmlPort that you specify does not exist, a run-time error occurs.\nInStream\nType: ../instream/instream-data-type\nThe source from which the import XmlPort object will read the XML data stream.\n*[Optional] Record*\nType: ../record/record-data-type\nThe record to use in the XmlPort. Any filters that are attached to the record will be used. This parameter is optional. If this parameter is omitted, all records in the table are imported. For example, you can use this parameter to change the values of properties such as FieldSeparator or TextEncoding, depending on each record that is 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\nxmlport-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}