• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum
    • Categories
    • Recent
    • Popular
    • Tags
    • Register
    • Login

    [ANSWERED] Json question (id)

    How To... ?
    2
    5
    204
    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.
    • ArmandoA
      Armando Beta Gold
      last edited by Woland

      Hello all,

      I am studying Json structure to better understand the bundling and the parsing of data. Although Mark's examples in the help section of the site are clear and function perfectly I tried other examples and I wasn't able to make the work completely. I think it has to do with how Isadora is managing the id

      {
        "student": [ 

           { 
              "id":"01", 
              "name": "Tom", 
              "lastname": "Price" 
           }, 

           { 
              "id":"02", 
              "name": "Nick", 
              "lastname": "Thameson" 
           } 
        ]   
      }

      As you can see in the image it is pretty simple, but Id don't seem to work correctly. The example was taken here

      What is wrong ?


      Thanks


      Armando Menicacci

      www.studiosit.ca
      www.armandomenicacci.net

      Macbook pro 16 inches 2022 64 GB RAM, M1 MAX. OS 14 Sonoma

      DusXD 1 Reply Last reply Reply Quote 0
      • DusXD
        DusX Tech Staff @Armando
        last edited by Woland

        @armando said:

        pretty simple, but Id don't seem to work correctly

         I believe it is working as expected. The issue here is that the selection is not done using the "id" value in the JSON data. The selection is made based on the numeric index. The index is zero-based, so this is why you see selecting 0 outputs the JSON with the 'id' of '01'. The position-based index has no relationship to the data's "id".


        If you want to combine the selections together so you use fewer JSON Parsers, I added a few to the bottom of this screen capture.


        If you want to get the data for a Student where the "id" value equals a specific value you need to send the JSON into the Javascript actor and loop through the values looking for a match.

        Troikatronix Technical Support

        • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
        • Isadora Add-ons: https://troikatronix.com/add-ons/
        • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

        Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

        1 Reply Last reply Reply Quote 2
        • ArmandoA
          Armando Beta Gold
          last edited by

          Thanks a lot @dusx,

          everything works like a charm now, Although I don't really get the javascript workaround to use less Json parsers and "loop through the values. Whwt do you mean can you give an example please ?

          Thanks

          Armando


          Armando Menicacci

          www.studiosit.ca
          www.armandomenicacci.net

          Macbook pro 16 inches 2022 64 GB RAM, M1 MAX. OS 14 Sonoma

          DusXD 1 Reply Last reply Reply Quote 0
          • DusXD
            DusX Tech Staff @Armando
            last edited by

            @armando said:

            loop through the values

             I wasn't sure how you wanted to find the values.
            For example if you wanted the values for any student with the lastname "Price", using javascript you could search all the students and return the records for any that match.
            In the case of these student ID's you might search for the student with the id of "01" get the details for Tom Price.

            Troikatronix Technical Support

            • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
            • Isadora Add-ons: https://troikatronix.com/add-ons/
            • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

            Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

            ArmandoA 1 Reply Last reply Reply Quote 0
            • ArmandoA
              Armando Beta Gold @DusX
              last edited by

              @dusxThanks,

              I still don't know wow to do that in Javascript, bit it is nice to know that is is possible.

              Thanks again


              Armando Menicacci

              www.studiosit.ca
              www.armandomenicacci.net

              Macbook pro 16 inches 2022 64 GB RAM, M1 MAX. OS 14 Sonoma

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