You are using nested foreach tag for ‘TABLE1’ and ‘TABLE2’ in template document. The JSON data source must contains the nested TABLE data source. Please use the following JSON string for nested foreach template to get the desired output.
String jsonData = "{\"TITLE\":\"Test\",\n" +
"\n" +
"\"TABLE1\":\n" +
"[\n" +
" {\"ID\":\"T00001\", \"TITLE\":\"TEST LIST 1\",\n" +
"\"TABLE2\":[{\"ID\":\"T00001\", \"SEQ\":1, \"TITLE\":\"TEST LIST 1 DETAIL 1\"},{\"ID\":\"T00001\", \"SEQ\":2, \"TITLE\":\"TEST LIST 1 DETAIL 2\"},{\"ID\":\"T00002\", \"SEQ\":1, \"TITLE\":\"TEST LIST 2 DETAIL 1\"},{\"ID\":\"T00002\", \"SEQ\":2, \"TITLE\":\"TEST LIST 2 DETAIL 2\"}]\n" +
"},\n" +
"\n" +
" {\"ID\":\"T00002\", \"TITLE\":\"TEST LIST 2\",\n" +
"\n" +
"\"TABLE2\":[{\"ID\":\"T00001\", \"SEQ\":1, \"TITLE\":\"TEST LIST 1 DETAIL 1\"},{\"ID\":\"T00001\", \"SEQ\":2, \"TITLE\":\"TEST LIST 1 DETAIL 2\"},{\"ID\":\"T00002\", \"SEQ\":1, \"TITLE\":\"TEST LIST 2 DETAIL 1\"},{\"ID\":\"T00002\", \"SEQ\":2, \"TITLE\":\"TEST LIST 2 DETAIL 2\"}]\n" +
"}\n" +
"]\n" +
"}";
Please note that this JSON data source does not work for second table in the document. You need to use the data source according to template document.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.