community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

Business Central 2025 wave 1 (BC26.1): New method to add SecretText values to JSON objects – WriteWithSecretsTo

In Business Central 2025 wave 1 (BC26.1), the JsonObject type gets a new method, WriteWithSecretsTo. It takes a dictionary that maps JSONPath placeholder paths to SecretText values, puts each secret in place of its placeholder, and writes the serialized JSON to a SecretText result. The method needs runtime 15.1 or later.

post Dynamics 365 Lab

Yun Zhu · 2025-05-13 · 450 words · about 2 min

"A new method was added to the JsonObject type, which allows developers to add SecretText values."

Key points

  • WriteWithSecretsTo is a new method on the JsonObject type that adds SecretText values to JSON objects
  • Developers create a JSON object with placeholders, define paths in JSONPath format, and use the method to produce a SecretText with credentials replaced
  • The feature integrates with the SecretText type introduced in BC23 to protect sensitive values from exposure
  • Method requires runtime version 15.1 or greater; not available in 15.0

Quotes

  • “A new method was added to the JsonObject type, which allows developers to add SecretText values.” (Introduces the core capability for securely embedding secrets in JSON structures)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

  • other “JsonObject”

Heads up

  • preview-disclaimer: “‘WriteWithSecretsTo’ is not available in runtime version ‘15.0’. The supported runtime versions are: ‘15.1’ or greater.” (about version 15.0)

Context

  • Features: WriteWithSecretsTo method, SecretText handling in JSON, JSONPath format support, Secure credential management
  • Versions: BC26, BC26.1, 2025 wave 1

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.