Skip to main content
Table of Contents

TTMSFNCDataLinkJSON Class

Data link component that loads and saves JSON data for TTMSFNCDataSet.

API unit family: TMS.TMSFNCDataLinkJSON Inherits from: TTMSFNCCustomDataLinkJSON

Syntax

GeneratedPascalC++
TTMSFNCDataLinkJSON = class(TTMSFNCCustomDataLinkJSON)
class PASCALIMPLEMENTATION TTMSFNCDataLinkJSON : public TTMSFNCCustomDataLinkJSON

Properties

Name Description
DataRootElement Gets or sets the JSON element that contains the record array. (inherited from TTMSFNCCustomDataLinkJSON)
DateTimeFormat Gets or sets the date/time format used for JSON values. (inherited from TTMSFNCCustomDataLinkJSON)
MetaDataElement Gets or sets the JSON element that contains field metadata. (inherited from TTMSFNCCustomDataLinkJSON)

Methods

Name Description
GetFileFilter Returns the file dialog filter for JSON files. (inherited from TTMSFNCCustomDataLinkJSON)
LoadFromStream Loads JSON data from a stream. (inherited from TTMSFNCCustomDataLinkJSON)
SaveToStream Saves the current JSON data to a stream. (inherited from TTMSFNCCustomDataLinkJSON)

Usage examples

Configure, load, and persist structured JSON

Combines nested data selection, metadata, date conversion, dataset linking, and automatic persistence.

Configure, load, and persist structured JSONPascal
begin
  TMSFNCDataSet1.Close;
  TMSFNCDataSet1.DataLink := TMSFNCDataLinkJSON1;

  TMSFNCDataLinkJSON1.DataRootElement := 'data';
  TMSFNCDataLinkJSON1.MetaDataElement := 'columns';
  TMSFNCDataLinkJSON1.DateTimeFormat := 'yyyy-mm-dd';
  TMSFNCDataLinkJSON1.FileEncoding := feUTF8;
  TMSFNCDataLinkJSON1.AutoSaveChanges := True;
  TMSFNCDataLinkJSON1.LoadFromFile('customers.json', TEncoding.UTF8);

  TMSFNCDataSet1.Open;
end;

Read the related guide