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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support