{"title":"JsonObject.WriteWithSecretsTo(Text, SecretText, var SecretText) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/jsonobject/jsonobject-writewithsecretsto-text-secrettext-secrettext-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/jsonobject/jsonobject-writewithsecretsto-text-secrettext-secrettext-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/jsonobject/jsonobject-writewithsecretsto-text-secrettext-secrettext-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":"Replaces the placeholder value in the path with the secret and then serializes and writes the content of the JsonObject to a SecretText.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"JsonObject.WriteWithSecretsTo(Text, SecretText, var SecretText) Method","slug":"jsonobjectwritewithsecretstotext-secrettext-var-secrettext-method","at":0,"chars":1202},{"level":2,"title":"Syntax","slug":"syntax","at":271,"chars":116},{"level":2,"title":"Parameters","slug":"parameters","at":387,"chars":449},{"level":2,"title":"Return Value","slug":"return-value","at":836,"chars":235},{"level":2,"title":"See Also","slug":"see-also","at":1071,"chars":131}],"text":"# JsonObject.WriteWithSecretsTo(Text, SecretText, var SecretText) Method\n> Version: _Available or changed with runtime version 15.1._\nReplaces the placeholder value in the path with the secret and then serializes and writes the content of the JsonObject to a SecretText.\n## Syntax\n```al\n[Ok := ]  JsonObject.WriteWithSecretsTo(Path: Text, Secret: SecretText, var Result: SecretText)\n```\n## Parameters\nJsonObject\nType: jsonobject-data-type\nAn instance of the jsonobject-data-type data type.\nPath\nType: ../text/text-data-type\nThe path to the placeholder value, which will be replaced by the secret, in a JPath format.\nSecret\nType: ../secrettext/secrettext-data-type\nThe secret with which the placeholder value will be replaced.\nResult\nType: ../secrettext/secrettext-data-type\nThe SecretText object to which the JSON data will be written.\n## Return Value\n*[Optional] Ok*\nType: ../boolean/boolean-data-type\ntrue if the write was successful; otherwise, false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.\n## See Also\njsonobject-data-type\nGetting started with AL<../../devenv-get-started>\nDeveloping extensions<../../devenv-dev-overview>"}