JsonTemplateLoad

 

The JsonTemplateLoad function loads JSON templates.

Each time it is loaded, the template string and template placeholder queue for the template ID are initialized.

 

It reads the JsonTemplate string set in the Studio Configuration menu> API Settings> JSON Template Settings window.

 

string @JsonTemplateLoad(string templateId);

 

Parameters

string tempateId   : Template ID to load

  

Return Values

Returns template content on success

Returns template content on success ...

 

Example )

string templateID = "template1";
string templateString = @JsonTemplateLoad(templateID);
// Load the JSON template saved as template1. The templateString variable returns the template default value.


@JsonTemplateReplacePlaceholder(templateID , "#NAME#", "Hong Gil-dong", "string");     // Change the placeholder written as #NAME# to the string "Hong Gil-dong".
@JsonTemplateReplacePlaceholder(templateID , "#AGE#", 20, "int");     // Change the placeholder written as #AGE# to the integer 20.
templateString = @JsonTemplateReplaceDone(templateID);                     // Apply the registered placeholder values to the JSON template.


@JsonTemplateTagSet(templateString);                 // Change all tag placeholders written as #$AI_0000# to the current tag values.
@JsonTemplateReplaceMissing(templateString); // Replace remaining placeholders (#OOO#) with null.
@ObjectSetText("Text1", templateString);             // Display the final JSON template string in the Text1 text element.

 

Version information

Supported Version: 10.3.6.25 or later

 

Related Helps)

JsonStructNew

JsonAppend

JsonSet

JsonToString

JsonClear

JsonGet

JsonFromString

JsonSetValue

JsonGetValue

JsonClearAll

JsonStringGetValue

JsonStringSetValue

JsonTemplateLoad

JsonTemplateReplacePlaceholder

JsonTemplateReplaceDone

JsonTemplateReplaceMissing

JsonTemplateTagSet