JsonTemplateReplaceMissing

 

The JsonTemplateReplaceMissing function changes the remaining placeholders in the JSON template string to null.

 

int @JsonTemplateReplaceMissing(ref string jsonContent);

 

Parameters

string jsonContent  : JSON string to be processed (modified content will be returned back)

  

Return Values

1 : Success

0 : Failure

 

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