HISE Logo Forum
    • Categories
    • Register
    • Login

    Parse a JSON file

    Scheduled Pinned Locked Moved Scripting
    4 Posts 2 Posters 218 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
      • d.healeyD
        d.healey
        last edited by

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

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

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

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

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @Lumi283
            last edited by d.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));
            });
            

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

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

            32

            Online

            1.8k

            Users

            12.0k

            Topics

            104.3k

            Posts