MV [SOLVED] Creating pages in a menu based on JSON values

I was wondering how plugin developers typically use JSON values for creating pages for each item in a list. I'm customizing a plugin to use JSON data that is downloaded prior to the game starting up with the following parameters:

  1. The name of the entry in the list. This is what the player selects in the list to view information for the item.
  2. The rest of the values are details related to the item. Let's say for example that the second and third entries in the list are descriptions of the item, for example if you want a separate description depending on the state of the item (such as in the case of achievements whose descriptions are different than before they have been earned so you have a pre field and a post field).
  3. Continuing with the achievement example, the fourth value can be called points, this is how much the achievement is worth.
  4. The fifth and final value in this example is called secret: it determines if the achievement details should be hidden until it's earned.
So far I have managed to create a file containing the validated JSON with the aforementioned details for each item which for the purpose of my implementation is being loaded from that same file, which is then supposed to be parsed for the purpose of filling out the list in the plugin's information scene. However, for some reason the parsed data is not populating the list (it shows up as completely empty). Is there anything that I am missing in terms of how the information should be read by the plugin to actually fill the list of items?

(Also, and in case it helps, the methodology is based on how the CGMV achievements plugin is designed, but with the switches, variables and rewards data stripped out since I don't need them for my implementation.)
Can you show me how you're currently trying to parse the JSON and populate the list?
Unfortunately it's not going to be immediately possible as I was required to shut off my development equipment as I am away for the Thanksgiving holiday, so I'm really not going to be able to do much until Monday. (Probably should have mentioned that sooner, of course.) I will follow up with more information when I can, however.

OK, so I got back to the development equipment earlier than planned so I have a few updates on the subject of JSON data parsing. Specifically, it's a customized variation on the CGMV achievements plugin with the following JSON values:

JSON:
[{"Name":"My Body is Ready","Points":"5","Pre Description":"Complete the prologue.","Post Description":"You completed the prologue.","Secret":"false"},{"Name":"Who's the Boss?","Points":"5","Pre Description":"Survive a boss encounter.","Post Description":"You survived a boss encounter.","Secret":"false"},{"Name":"Warp Zoned","Points":"5","Pre Description":"Cross a transport vortex.","Post Description":"Crossed a transport vortex.","Secret":"false"},{"Name":"Community in Crisis","Points":"5","Pre Description":"You have entered a crisis zone.","Post Description":"Enter a crisis zone.","Secret":"false"},{"Name":"Walk Among the Ruins","Points":"5","Pre Description":"Enter an abandoned settlement.","Post Description":"You have entered an abandoned settlement.","Secret":"false"},{"Name":"An Elementary Observation","Points":"5","Pre Description":"You have taken a case for Sherlock Investigations","Post Description":"Take a case for Sherlock Investigations","Secret":"false"},{"Name":"Ladies, Please...","Points":"5","Pre Description":"Gain entry to the women's dominion.","Post Description":"You have been granted entry to the women's dominion.","Secret":"false"},{"Name":"Fated Arrival","Points":"5","Pre Description":"Enter the sacred azimuth","Post Description":"You entered the sacred azimuth.","Secret":"false"},{"Name":"Hideaway Hollows","Points":"5","Pre Description":"Discover the hidden elven village","Post Description":"You have discovered the hidden elven village.","Secret":"false"},{"Name":"Blade of Destiny","Points":"10","Pre Description":"Receive the Excalibur Sword.","Post Description":"You have received the Excalibur Sword.","Secret":"false"},{"Name":"Shield of Destiny","Points":"10","Pre Description":"Receive the Excalibur Shield.","Post Description":"You have received the Excalibur Shield.","Secret":"false"},{"Name":"Armour of Destiny","Points":"10","Pre Description":"Receive the Excalibur Armour.","Post Description":"You have received the Excalibur Armour.","Secret":"false"},{"Name":"Headgear of Destiny","Points":"10","Pre Description":"Receive the Excalibur Helm.","Post Description":"You have received the Excalibur Helm.","Secret":"false"},{"Name":"Final Approach","Points":"10","Pre Description":"Enter the final dungeon.","Post Description":"You have entered the final dungeon.","Secret":"false"},{"Name":"Sailing Away","Points":"10","Pre Description":"Command the galleon.","Post Description":"The galleon is at your command.","Secret":"false"},{"Name":"Sky High","Points":"10","Pre Description":"Awaken the sky guardian.","Post Description":"The sky guardian has awakened.","Secret":"false"},{"Name":"Hard Truth","Points":"15","Pre Description":"It's a secret to everybody","Post Description":"You have learned the truth of your origin.","Secret":"true"},{"Name":"Release the Kraken","Points":"15","Pre Description":"Encounter Krakena Oceanos.","Post Description":"You have had an encounter with Krakena Oceanos.","Secret":"false"},{"Name":"Good Grief","Points":"15","Pre Description":"It's a secret to everybody","Post Description":"You have been a witness to mortal sacrifice.","Secret":"true"},{"Name":"Census Agent","Points":"20","Pre Description":"Visit all of the towns and dominions.","Post Description":"You have visited all of the towns and dominions.","Secret":"false"},{"Name":"Divinity's Witness","Points":"20","Pre Description":"Visit all of the sacred monuments.","Post Description":"You have visited all of the sacred monuments.","Secret":"false"},{"Name":"Dungeon Master","Points":"20","Pre Description":"Venture into all of the caves and towers.","Post Description":"You have ventured into all of the caves and towers.","Secret":"false"},{"Name":"Nerf This","Points":"20","Pre Description":"Successfully exploit an enemy's weakness.","Post Description":"You have exploited an enemy's weakness.","Secret":"false"},{"Name":"Over 9000","Points":"20","Pre Description":"Use an advent power.","Post Description":"You have used an advent power.","Secret":"false"},{"Name":"Act of Nature","Points":"25","Pre Description":"It's a secret to everybody","Post Description":"Dryadi Leafen has been restored.","Secret":"true"},{"Name":"Red Hot Resolution","Points":"25","Pre Description":"It's a secret to everybody","Post Description":"Orochi Himituko has been restored.","Secret":"true"},{"Name":"Cold as Ice","Points":"25","Pre Description":"It's a secret to everybody","Post Description":"Demeria Frostworth has been restored.","Secret":"true"},{"Name":"King of Kong","Points":"25","Pre Description":"It's a secret to everybody","Post Description":"Li Wukong has been restored.","Secret":"true"},{"Name":"Lonesome Love","Points":"25","Pre Description":"It's a secret to everybody","Post Description":"The sucubbi sisters have been restored.","Secret":"true"},{"Name":"From the Ashes","Points":"25","Pre Description":"It's a secret to everybody","Post Description":"Phoenix Desu has been restored.","Secret":"true"},{"Name":"Cast in Stone","Points":"25","Pre Description":"It's a secret to everybody","Post Description":"Medusa Spartos has been restored.","Secret":"true"},{"Name":"Gone with the Wind","Points":"25","Pre Description":"It's a secret to everybody","Post Description":"Ventos Stormsworth has been restored.","Secret":"true"},{"Name":"Bring It On","Points":"30","Pre Description":"Begin the transpod trial.","Post Description":"The transpod trial has begun.","Secret":"false"},{"Name":"Divine Reawakening","Points":"30","Pre Description":"Restore all of the guardians.","Post Description":"The guardians have all been restored.","Secret":"false"},{"Name":"Demon Slayer","Points":"30","Pre Description":"Defeat all of the unnamed's agents.","Post Description":"You have defeated all of the unnamed's agents.","Secret":"false"},{"Name":"Conquer Yorselves","Points":"30","Pre Description":"Win a battle against your divine doubles.","Post Description":"You have won a battle against your divine doubles.","Secret":"false"},{"Name":"Swift Reversal","Points":"30","Pre Description":"Turn the tables on an opponent following a battle with him.","Post Description":"You have turned the tables on an opponent after conquering him in battle.","Secret":"false"},{"Name":"Master of None","Points":"35","Pre Description":"Defeat all of the bosses.","Post Description":"You have defeated all of the bosses.","Secret":"false"},{"Name":"Spirited Away","Points":"35","Pre Description":"Cross the depths of existence.","Post Description":"You crossed the depths of existence.","Secret":"false"},{"Name":"That's Not the God You're Looking For","Points":"35","Pre Description":"It's a secret to everybody","Post Description":"The truth of Duesa's curse has been exposed.","Secret":"true"},{"Name":"Dawn of the Advent","Points":"35","Pre Description":"Unite the Excalibur Armaments.","Post Description":"The Excalibur Armaments have been united.","Secret":"false"},{"Name":"Victory Royale","Points":"50","Pre Description":"Destroy the unnamed threat.","Post Description":"The unnamed threat has been destroyed.","Secret":"false"},{"Name":"Extra Credit","Points":"100","Pre Description":"Complete the credit roll sequence.","Post Description":"You have completed the credit roll sequence.","Secret":"false"},{"Name":"Contra Runeria","Points":"100","Pre Description":"Enter the special code when the time is right.","Post Description":"You entered the special code at exactly the right time.","Secret":"true"}]

And the following function reads in the saved JSON data (assuming the default data folder in the game package):

JavaScript:
CGMV_Core.prototype.initializeAchievements = function(reinitialize) {
    if (!this._achievements || reinitialize) {
        $.ajax({
            type: "GET",
            url: "data/achievements.json",
            dataType: "text",
            success: function (data) {
                CGMV.Achievements.Achievements = JSON.parse(data);
            }
        });
        console.log(achievement);
        this.setupAchievementVariables();
    }
    var id = this._achievements.length + 1;
    for(var i = 0; i < CGMV.Achievements.Achievements.length; i++) {
        var achievement = new CGMV_Achievement(CGMV.Achievements.Achievements[i], id);
        if(!this.getAchievementByName(achievement.getName())) {
            this.commitAchievement(achievement);
            id++;
        }
    }
};

The problem I'm having is with parsing the JSON values without any of the other stuff that is in the stock CGMV achievements plugin (such as rewards and variable/switch control), as it is unnecessary for my requirements and takes up space in the JSON data that I really don't need. Unfortunately it's not functioning properly as the achievements scene is completely devoid of any information. So I am trying to figure out what could be happening to cause this.

Apologies if this goes against double post rules, but I think I found the problem. Apparently, the list is actually being parsed correctly; however, the list length at the time of the attempt to load the achievements is a big fat zero which essentially means that there is nothing to load. I'm going to use this information to rearrange the detection logic in order to accommodate this discovery, and if my deductions are correct that should take care of the issue.

EDIT: It's confirmed. I did have to change the ajax request to a fetch request and remove all of the JSON.parse calls, but the list is now being populated. Only a few more things remain to be implemented, but the core problem is now resolved.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-creating-pages-in-a-menu-based-on-json-values.163177/