Create JSON-file from NAV data

Hi All.

Just decided to understand how to create JSON-file from NAV data by AL (the main point - it NOT parses the JSON-file from a server, but opposite - create JSON-file).

Lest imagine we have structure:

		supertype: TYPE1,
		achInfo: {
			accountNumber: "312312312",
			routingNumber: "121122676",
		supertype: TYPE2,

Based on structure we can have something like:

                JsonObjectLine.Add('accountNumber', BankAccountNo);
                JsonObjectLine.Add('routingNumber', BankBranchNo);

// I created JsonObjectLine because I need to create sub-set of data for "achInfo". And question #1 - Do you know how to do it without extra-step & variable?

                JsonObjectHeader.Add('supertype', LowerCase"YGO Export Payment Method"));
                JsonObjectHeader.Add('achInfo', ResponseText);

                JsonObjectHeader.Add('supertype', 'TYPE2');
                JsonObjectHeader.Add('email', Email_from_DB);


// we have the error in the line with TYPE2 (selected ""):

Microsoft Dynamics NAV
The JSON object already contains the key 'supertype'.

I tried to use the JsonArrayHeader.RemoveAll, but my VSC (V1.30.2) answered - "JsonObject' does not contain a definition for 'RemoveAll".

I think I no need to write the second question, right?

P.S. Duthe ring investigation I found 1 example with loop conbination of Sales Header&Line where lines was added by command JsonArrayHeader.Add(JsonArrayLines);

But it is not solve the issue if we have at least 2 orders