---
id: post/yzhums-com/64057
type: post
title: "Business Central 2025 wave 1 (BC26.1): New method to add SecretText values to JSON objects – WriteWithSecretsTo"
summary: 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.
tier: community
language: en
tags:
  - secrettext
  - json
  - al development
  - security
  - credentials
  - sensitive data
  - jsonobject
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-26T06:42:40.324Z"
  flags: []
generated:
  at: "2026-10-26T05:51:10.938Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 470ca5ed8592011b022f04364e42699c79b806964713e2bbd70861a44bb770d6
evidence:
  - kind: blog
    url: https://yzhums.com/64057/
    title: "Business Central 2025 wave 1 (BC26.1): New method to add SecretText values to JSON objects – WriteWithSecretsTo"
    date: "2025-05-13"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/64057/
    title: "Business Central 2025 wave 1 (BC26.1): New method to add SecretText values to JSON objects – WriteWithSecretsTo"
    date: "2025-05-13"
    commit: null
    t: null
    quote: A new method was added to the JsonObject type, which allows developers to add SecretText values.
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "64057"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/64057/
published_at: "2025-05-13T01:34:06.000Z"
author: Yun Zhu
full_text: false
words: 450
quotes:
  - text: A new method was added to the JsonObject type, which allows developers to add SecretText values.
    why_it_matters: Introduces the core capability for securely embedding secrets in JSON structures
code_objects_mentioned:
  - other JsonObject
systems:
  - development
  - integration
versions_mentioned:
  - BC26
  - BC26.1
  - 2025 wave 1
cautions:
  - kind: preview-disclaimer
    quote: "'WriteWithSecretsTo' is not available in runtime version '15.0'. The supported runtime versions are: '15.1' or greater."
    objects: []
    events: []
    versions:
      - "15.0"
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2025/05/Snipaste_2025-05-13_10-30-44.png
  image_alt: null
  image_w: null
  image_h: null
  site_name: Dynamics 365 Lab
  favicon: https://yzhums.com/wp-content/uploads/2020/08/cropped-logo-3-32x32.png
  probed_at: "2026-10-26T06:20:42.651Z"
---

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

[Read the post](https://yzhums.com/64057/) · Dynamics 365 Lab - Yun Zhu (Yun Zhu, MVP) · 2025-05-13 · 450 words · tier community · reviewed (checked by Opus)

> 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.

## 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.
