Jump to content

Recommended Posts

Hello,

I m having difficulties with Lava JSON API lib. I'm not good at Labview but if you can help me. I don't see a documentation or a small exemple.

My REST API return me this kind of string :

[
    {
        "id": "Cartographie",
        "records": [
            "20190801-162634"
        ],
        "name": "Cartographie",
        "description": "",
        "lft": 1,
        "rght": 2,
        "tree_id": 3,
        "level": 0,
        "parent": null
    },
    {
        "id": "Cyclage endurance",
        "records": [
            "20190909-140001",
            "20190703-100000",
            "20190603-110704"
        ],
        "name": "Cyclage endurance",
        "description": "Some descriptions",
        "lft": 1,
        "rght": 2,
        "tree_id": 4,
        "level": 0,
        "parent": null
    }
]

 

I need to make an array of ids or names.

How would you do that easily ?

 

 

Share this post


Link to post
Share on other sites
4 hours ago, Thomas Pedot said:

How would you do that easily ?

You certainly can do this with LAVA JSON, but I would suggest you use the JSONtext library instead, if possible:

1476726708_GetallNames.png.85c9ea951027cc06974be27c2f7a7b9e.png

Share this post


Link to post
Share on other sites

Ok. I'm not a LabView expert.

I expected values in table Names, e.g. Cartographie instead of name (for exemple).

At the end I want to make a drop down menu for the front end.

 

Thanks !

 

Share this post


Link to post
Share on other sites

Oops, two things called "name".  The "Names" output is an array of item names.  Your item name is, confusingly, "name".  "Cartographie" is one of your date values.  It is a string, and I in my example provided a string as the data type.  But you provided as data type an empty/void Variant, which will fail.  Use a string like in my example.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.