Skip to content

Tag: json

trying to get specific data from API response

Trying to get “equity” data from a API response for calculate but can’t get through. This is my code: Keep getting TypeError: And this is data I am trying to tear apart: Answer Done with this type, go through json.dumps and json.loads and track the data in equity to get number in json

python – json , how to make a json flat

so i have a nested json that contains two groups , each group has a field that contains more sub groups i would like to pop all the sub groups out to flatten the json and remove the sub groups field What is the correct way to do it JSON : This is the expected result: I need to pop

Extract specific value from JSON with Python

I am trying to get all the websites from this json file Unfortunately, when I use this code: I get following error: Any help is appreciated. Thank you in advance Answer Use raw data to get raw json and then iterate over ‘tokens’ attr of the response object:

Convert flat JSON to nested JSON with PHP

I have a JSON file with a single array and all elements in the same level. Each of the entries has a “level” attribute between 1 and 4. I want to have a nested array in the end which has all level 4 inside the level 3, all level 3 inside the level 2, all level 2 inside the level

Convert json from file to map not working

i have this code which gives the error “Error: Uncaught (in promise): TypeError: this.weekMap.get is not a function”. Why weekMap is not recognized as a Map object? The Json file contains: } Answer You are not converting the variable weekMap to a Map object correctly. Try the Object.entries function:

execute powershell from SSMS

I am trying to execute as certain xp_cmdshell code: but this is the error that I get: when I try an execute the same thing in powershell I get the expected response(see image) Powershell The expected output from the xp_cmdshell should be a json Answer The error message implies that your command line is being executed via cmd.exe, where &