Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › JsonList search through objects

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #23446

    jrrobles79

    How can I filter or search a json object depending on an object on an array inside an json object, for example:

    I was trying to clear a little bit my code and wanna rearrange my apis like a json object:

    readonly property var mApis:[
       {
          "id":"login",
          "url":"/path/to/login",
          "errors":[
             {
                " code":404,
                " msg":"User not found"
             },
             {
                "code":405,
                "msg":"User suspendend"
             }
          ]
       } ,
    ...
    ... 
    ]

     

    How can I get the error message 405 for the api ‘login’? I know that there is the method indexOF(‘id’,’login’) and maybe loop through the errors array content until find it, but isn’t a more direct way to do this?

     

Viewing 1 post (of 1 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded