I am not getting the correct info while extracting some particular key value from nested json. please help in correcting the code

I want to extract the task name and config corresponding to each task into new variable. The code that I have shared is not giving me the desired output. Although it is extracting some info but it is not able to extract all the required details. Here is the json: old = { "tasks": [… Read More I am not getting the correct info while extracting some particular key value from nested json. please help in correcting the code

How to access nested JSON data | REACT

I have a problem when trying to fetch one nested JSON object from local API endpoint /user/{id} that looks like this : {"userId":122,"name":"kissa","email":"kissa@kissa.com","phone":"04819283921","profile":{"profileId":1,"profileName":"student"}} Everything else works like a charm but when trying to implement "user.profile.profileName" it gives me an error when reloading the page: Uncaught TypeError: Cannot read properties of undefined (reading ‘profileName’) User.jsx import… Read More How to access nested JSON data | REACT

Is it possible to rename a json key name using its value in Python?

I have this nested json dictionary and I want to rename the key name ‘Keys’ with its equivalent value using Python. I wonder if this is possible? Current – ‘Keys’: [‘AWS Backup’] I want it to be – ‘AWS Backup’: [‘AWS Backup’] Sample json dictionary {‘TimePeriod’: {‘Start’: ‘2022-11-28’, ‘End’: ‘2022-11-29’}, ‘Total’: {}, ‘Groups’: [{‘Keys’: [‘AWS… Read More Is it possible to rename a json key name using its value in Python?

Send nested JSON data with image/file from postman: Django REST framework

I want to POST the following data: { "user": { "name": "user name", "email": "user@example.com", "phone_number": "01XXXXXXXXX", "user_type": "MGR" }, "img": "image_data", "manager_brands": [ 2, 1 ] } How can I pass this JSON data through postman? Challenges I am facing: This is a nested JSON data I am passing an image with it. Note:… Read More Send nested JSON data with image/file from postman: Django REST framework

Writing a program to take user input and prints output from the Nested json file

I have a nested json file with the below data and I need some help in writing an interactive program where it should take a topping as input and prints out the names of all the donuts that have this topping. [ { "id": "0001", "type": "donut", "name": "Cake", "ppu": 0.55, "batters": { "batter": [… Read More Writing a program to take user input and prints output from the Nested json file