Forum
    • Categories
    • Register
    • Login

    Parse a JSON file

    Scheduled Pinned Locked Moved Scripting
    4 Posts 2 Posters 274 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      Lumi283
      last edited by

      Do you know how to retrieve the url of the JSON file corresponding to expansion number x? In JavaScript, you can use map, but do you know how to do it in HISE?
      Thank you

      "result": [
          {
            "_id": "65354a6e1f6318b08c7612cc",
            "expansion_version": 2,
            "url": "url2"
          },
          {
            "_id": "65354a7706a49c291b423e1e",
            "expansion_version": 3,
            "url": "url3"
          }
        ],
      
      1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey
        last edited by

        57271b96-e845-4fa4-9967-255d410ee13b-image.png

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        1 Reply Last reply Reply Quote 0
        • L
          Lumi283
          last edited by

          I tried, but it seems to work only for arrays...

          David HealeyD 1 Reply Last reply Reply Quote 0
          • David HealeyD
            David Healey @Lumi283
            last edited by David Healey

            @Lumi283 Your example result is an array...

            const result = [
                {
                  "_id": "65354a6e1f6318b08c7612cc",
                  "expansion_version": 2,
                  "url": "url2"
                },
                {
                  "_id": "65354a7706a49c291b423e1e",
                  "expansion_version": 3,
                  "url": "url3"
                }
              ];
            
            result.map(function(obj)
            {
            	Console.print(trace(obj));
            });
            

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            29

            Online

            2.1k

            Users

            13.0k

            Topics

            112.6k

            Posts