question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing way to extract only the keys from a JSON object

See original GitHub issue

Is your feature request related to a problem? Please describe.

I use [Send an HTTP request] feature to call an external REST API, which returns a JSON object that looks like this:

{
  "sheepdog": [
    "english",
    "shetland"
  ],
  "shiba": [],
  "spaniel": [
    "blenheim",
    "brittany",
    "cocker",
    "irish",
    "japanese",
    "sussex",
    "welsh"
  ]
}

I would like to get an array containing only the keys from this JSON result and let the user select it, but I can’t find such a function in the adaptive expressions and can’t achieve it. In the above example, I want to enumerate only seepdog, shiba, and spaniel.

Actually, you can try it with the following open source API.

https://dog.ceo/api/breeds/list/all

Describe the solution you’d like

It seems to be possible to handle this by creating a custom action, but I’d like to achieve it without writing code.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shihanlkcommented, Jul 21, 2020

the result of that is image

Maybe the equal mark is missing?

Yes you are correct. now it comes like this. Thanks for the support. only thing now is to remove the []

image

0reactions
Danieladucommented, Jul 21, 2020

Yes you are correct. now it comes like this. Thanks for the support. only thing now is to remove the []

image

Cool!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extracting Keys from a JSONObject using keySet()
I basically want to store all the post_id values in an ArrayList. In order to do this, am trying to extract the keys...
Read more >
Get all the Keys in a JSON String Using JsonNode - Baeldung
In this article, we'll explore different ways to extract all the nested keys from a JSON using JsonNode. We aim to traverse through...
Read more >
Get all keys and values from json object in Python
In this Python tutorial we are going to see how we can get all the keys in this json object and also all...
Read more >
How to extract the keys from an Object in DataWeave using ...
In this tutorial, we'll learn different ways to get, extract, or retrieve an Array with all the keys from an Object. We'll use...
Read more >
The JSON_QUERY() function to extract objects from JSON Data
In this example, we require to retrieve the first JSON object from the [employees] key. A variable @data contains an array for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found