Questions tagged [json]

JSON (JavaScript Object Notation) serves as a versatile data exchange format that can be easily understood by both machines and humans. Please refrain from employing this label when referring to native JavaScript objects or JavaScript object literals. Prior to seeking assistance, ensure the validity of your JSON through an esteemed validator like JSONLint (https://jsonlint.com).

The Echart bar graph is not displaying when trying to use JSON data

Seeking assistance as a beginner in building Basic Bar inverted axes using json data. I am trying to achieve a chart similar to Bar Inverted Axes, but encountering issues with the chart not displaying properly. Utilizing Angular to develop the web applicat ...

What is the best way to change a date from the format DD/MM/YYYY to YYYY-MM-DD

Is there a way to use regular expressions (regex) to convert a date string from DD/MM/YYYY format to YYYY-MM-DD format? ...

extract objects from an array of objects based on a specified array

Within my JSON array, I have data structured like this: const data = [ { "uniqueId": 1233, "serviceTags": [ { "Id": 11602, "tagId": "FRRRR", "missingRequired&quo ...

Exploring Python's ability to access elements in JSON structures

Here is the code I am using to load my file: with open('filepath') as myfile: data = [next(myfile) for x in xrange(100)] print data print json.dumps(data, indent=1, sort_keys=False) When I view the structure obtained in the first case, it appears ...

The correct way to handle JSON parsing in the background using Flutter

Currently, I am venturing into the world of Flutter and facing challenges with JSON parsing. Initially, I followed the recipe for data fetching which worked smoothly with my custom JSON. However, when I transitioned to background parsing (which is more be ...

Exploring and organizing JSON data with PostgreSQL

I have a database table named api_details where I store a JSON value in the column raw_data. Now, I want to generate a report based on this JSON data with an expected outcome like the following: action_name sent_timestamp Sent ...

Navigating through disorganized JSON files with PHP

Hey there, I have a messy JSON data that I need to extract information from but I'm struggling with how to approach it. Here is the JSON sample: https://pastebin.com/55pWWgnK { "capacity_test": { "date": "2017-03-01", "status": "d ...

A guide to querying JSON data in a backend database with JavaScript

My backend JSON DB is hosted on http://localhost:3000/user and contains the following data: db.json { "user": [ { "id": 1, "name": "Stephen", "profile": "[Unsplash URL Placehol ...

Tips for streaming JSON data with Flink

I am currently working on a data stream, receiving a series of strings and aiming to calculate the total count of all these strings. The sum is aggregated, meaning that for each subsequent record, the sum includes the previous day's total as well. The desi ...

Get specific information from Firebase based on a certain field

I am working with Firebase and the database structure I have is as follows: Users user1 email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2a7baa3afb2aea7f382b6a7b1b6eca1adaf">[email protected]</a>" ...

Discovering a specific JSON object member by its corresponding string value

Let's consider a JSON file with information about books stored in it: { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "autho ...

Is it possible to utilize a JavaScript variable in this particular scenario and if so, what is the

let myVariable = <?php echo json_encode($a[i want to insert the JS variable here]); ?>; Your prompt response would be highly valued. Many thanks in advance. ...

Python - Retrieve data from a dataframe (JSON)

After taking a break from coding for some time, I am now diving back in as a beginner. I am currently using the requests library to fetch JSON data from the Incapsula API in order to collect stats about website traffic. My goal is to extract and write the ...

Using JavaScript to transform JSON information into Excel format

I have tried various solutions to my problem, but none seem to fit my specific requirement. Let me walk you through what I have attempted. function JSONToCSVConvertor(JSONData, ReportTitle, ShowLabel) { //If JSONData is not an object then JSON.parse will ...

Save and load parent-child associations with JsonConverter

My JSON structure consists of POCO classes with arrays of child-objects, like so: "Object": [ { "Name": "TestA", "ChildObjects": [ { "Name": "TestB" "ChildObjects": [ { ...

Executing an Ajax call to trigger a NodeJS function that executes a bash script

I have created a bash script to generate a JSON file that needs to be parsed and sent to the client-side JavaScript for display. My goal is to achieve this without refreshing the page and without using jQuery. I attempted to use Axios but seem to be facing ...

Running a shell script without double quotes can lead to errors in Ruby code

After creating some JSON data and passing it to another Python script, I realized that the double quotes around the JSON elements are missing. Here is a snippet of my code: json = @report.resultReportToJSON(result_type, result, unit) puts "#{json}" `"pyth ...

One way to have a Spring RESTful API return JSON in its true format rather than as a string is by serializing the

Currently, I am developing a RESTful API using Spring. The API structure is such that it displays all objects of its corresponding type. You can access the API at the following link: The Data Transfer Object (DTO) for this API is as follows: public class ...

Is there a way to utilize JSON.NET to deserialize a collection of JSON objects into an array?

The terms "array" and "objects" might not be exact, but you catch my drift. Looking at the sample for serializing/deserializing a custom object from the official documentation: product.Name = "Apple"; product.ExpiryDate = new DateTime(2008, 12, 28); p ...

Utilize Grunt to retrieve a JSON object from a file

I'm interested in utilizing the grunt-hash plugin to rename my JavaScript files. This plugin generates a new file that contains a map of renamed files: hash: { options: { mapping: 'examples/assets.json', //mapping file so your server can serve ...

The jQuery call to a web service is returning XML data, but the success function is receiving a

I have utilized: [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)] The outcome of my web service call is: <string xmlns="http://tempuri.org/"> [{_pkId:"",_code:"",_message:"The file has been uploaded successfully.",_sta ...

Incorporate geographical data from a JSON file into my Google Maps application

Hey there, I'm a newbie on this forum and could really use your expertise. I've put together an html5 page with Google maps using the API key from Google (My code is shown below), it's working fine with a central marker in place and loads perfectly when I ...

Suggestions for updating the 'begin' and 'finish' variables transmitted through ajax on fullcalendar?

Shown below is the URL to request JSON data via Ajax: '/php/get-events.php?start=2015-05-31&end=2015-06-07&_=1433154089490'. This query will fetch JSON data from 2015-05-31 to 2015-06-07. However, I am looking to retrieve data over a ...

Verify if the final (or initial) node containing a child with a specific value

Using XSLT 1.0, I have transformed the given XML into an array of JSON objects: <a id="x"> <active>Yes</active> </a> <a id="y"> <active>No</active> </a> <a id="z"> <active>Yes</act ...

Using the Onedrive API in Python for data manipulation

I'm struggling to write a Python script that can decode JSON data retrieved from my OneDrive. I've successfully authenticated and accessed the files, but I can't figure out how to extract the file names and URLs from the JSON response. The information I n ...

Utilizing React to dynamically load JSON data and render a component

I am currently facing a challenge in rendering a React component that includes data fetched from a JSON using the fetch() method. Although the API call is successful, I am experiencing difficulties in displaying the retrieved data. Below is the code snip ...

The reason behind my unsuccessful attempt to utilize AJAX with the Google GeoChart API

Learning about JavaScript is exciting! I recently tried incorporating a Google Geochart to generate visual reports. The sample code looked like this: function drawRegionsMap() { var data = google.visualization.arrayToDataTable([ ['Country', 'P ...

"Jquery's .append function may sometimes display as undefined when

$("#clckjson").click(function() { $(document).ready(function() { $.getJSON("fuelj.json", function(data) { $(data).each(function(i, item) { console.log(item.stationID); var $table = $('<table>'); $table.append("< ...

Encountering a problem with parsing JSONObject on Android

Encountering difficulty using the Android JSON object to parse a specific response. Struggling to create code that successfully parses this response "{"r":{"f":[1,0,15,5948]}}". Attempted to utilize the code below, but encountering an error: "No value fo ...

Getting a JSON file from a Minio server using node.js

Currently, I am trying to retrieve a json file from minio and then insert it into mongoDB using mongoose. When I use the getObject method, I am receiving a Buffer object Below is the code snippet that showcases my approach: let miniData minioClient.get ...

Iterating over an array of lists to tally the elements

I've been struggling to count the number of objects in an array using JavaScript. Below is the array I'm trying to work with: <script> var arr = [ {"gateways":["ccu1"],"manufacturer":["homematic"],"ir":["ir_no"],"ip":["ip_cam", ...

Exploring the Potential of Powershell, JSON, and Hashtables

Looking for Help [ { "example": "abc123", "exampleName": "abcd_test", "exampleShortcode": "", "isComplete": false }, { "example": "def456", ...

Converting a Postgres column into a JSON column

Is it possible to transform the integer column foo into a json array column bar? The provided solution seems ineffective as m2 is not recognized as a valid json expression... UPDATE mytable SET bar='[m2.foo]' FROM ( SELECT m.foo FROM mytable WHERE bar ...

Issue with Retrofit2 implementation of Query parameters

Here is a JSON response containing information about different books. [ { "title" : "Clean Code", "author" : "Robert Martin", "bookUrl" : "http://amzn.to/1DJybxH", "imageUrl" : "http://adavis.github.io/adept-android/images/clean_code.jpg", "displayDate" ...

Steps for converting an HTML form into a sophisticated JavaScript object

Is it possible to transform a form into a complex JavaScript object based on a structured form layout? I am not sure if there is a better way to accomplish this, but essentially what I am looking for is the following scenario: <form> <input n ...

When a string that has been encrypted is passed through json_decode, the function may return a

In an effort to protect my database information, I have implemented encryption using simple mcrypt functions for handling JSON data. Here are the functions I've created: function encrypt($key, $data){ $encrypted_data = mcrypt_cbc(MCRYPT_RIJNDAEL_192, ...

Develop JSON Object with C# Web Service

Learning the basics of C# Web Services to handle JSON data can be quite challenging. If you have a web service that returns data in JSON format, such as the following example: {"RESULT":"2","TKN":"E952B4C5FA9","URL_HOME":"My_Url_Home"} You may encounter ...

Can anyone guide me on troubleshooting the firebase import error in order to resolve it? The error message I am encountering is "Module not found: Error:

When attempting to import the 'auth' module from my 'firebase.js' file, I encountered an error. I used the code import {auth} from "./firebase", which resulted in the following error message: Error: Unable to locate module './firebase' in path ' ...

Validation of JSON array items

I am in need of a tool that can validate JSON data with specific examples. Here is the JSON fragment: { "optionsMinValue": 0 "optionsMaxValue": 56 "options": [ { "name": "name1&qu ...

Retrieving HTTP parameters in Classic ASP through JSON data format

My website is built using classic asp and I am in need of creating a page that can receive a callback from a third-party site with three parameters sent in JSON format. I then have to store these values in a database. I don't have any prior experienc ...

String Representation of Android View IDs

As I work on creating a Class that will populate my layouts with data from a JSON Schema, I am encountering a challenge. The JSON includes definitions such as { type: "checkbox", label: "Label text", value: true, id: "liquids" }. While rendering the UI is ...

Use Go lang with Gin to return an empty array instead of null for JSON responses

I have a struct: type ProductConstructed struct { Name string `json:"Name"` BrandMedals []string `json:"BRAND_MEDALS"` } When I use gin to return my object: func constructProduct(c *gin.Context) { var response ProductConst ...

I am encountering the org.json.JSONException error message stating that there is no value for a specific item in my JSON array

Despite having "feels_like" in my JSON array, the error log is indicating that it is not present. CODE: protected void onPostExecute(String s) { super.onPostExecute(s); try { JSONObject jsonObject = new JSONObject(s); ...

Retrieve the value from the initial element of the JSON array received from the GitAPI response within a shell script

I'm trying to retrieve the browser download URL for the latest release from a specific Git repository using the GitHub API. Sample command: curl -i https://api.github.com/repos/$owner/$repo/releases The response is in the form of a JSON array. Assuming ...

What methods can I use to gauge the loading time of an AJAX request and showcase a loading panel?

I am facing an issue with my AJAX request that sometimes deals with a large JSON object. I need to display a loading panel during this process, similar to the one shown in the image below (scaled at 45%): https://i.stack.imgur.com/rw9ft.jpg The problem I ...

Implementing serialization and deserialization functionality in Typescript for classes containing nested maps

I am currently facing a challenge in transforming Typescript code into NodeJS, specifically dealing with classes that contain Map fields of objects. I have been experimenting with the class-transformer package for serialization and deserialization (to JSON ...

Transform a JSON array into an array of objects using typescript

I have a JSON array that I need to convert into an object type array JSON array [ 0:{code: "00125", scheme: "0001", plotNumber: "125", propType: "001", plotType: "001"} 1:{code: "190", scheme: "0001", plotNumber: "NA 190", propType: "001", plotType: "0 ...

Struggling to manipulate JSON file in C#

Having a library application allows users to register as new users, add books, borrow them, and deposit. However, encountering an issue with the JSON file raises some concerns. The problem arises when trying to manipulate the data using a foreach loop. Odd ...

Python: Flattening and Extracting specific JSON segments

I've got an input JSON that has the following structure: > {"payment": {"payment_id": "AA340", "payment_amt": "20", "chk_nr": "321749", "clm_list": {"dtl": [{"clm_id": "1A2345", "name": "John", adj:{"adj_id":"W123","adj_cd":"45"}}, {"clm_id": "9999", " ...

Utilizing Json and Gson for Android Development

Could someone please explain the distinction between JSON and GSON to me? I keep coming across the term GSON while researching JSON, but I'm not sure how they differ. I'm confused about the specific differences between the two. Additionally, I've encount ...

Encountering issues launching cmd.exe using ProcessStartInfo

Web.config: <appSettings> <add key="MystemDirectory" value="D:mystem"/> </appSettings> Controller: if (flag) { db.FbDocuments.Add(fbDocument); db.SaveChanges(); var workingPath = WebConfigurationManager.AppSettings[ ...

A guide for implementing fast-json-patch in your Angular 2 projects

Looking to incorporate the "fast-json-patch" library into my Angular 2 project. This library can be found at https://github.com/Starcounter-Jack/JSON-Patch. I attempted to include the following code: 'fast-json-patch': 'vendor/fast-json-patch/dist/json-p ...

What is the best way to update JSON data using JQuery?

I apologize for posing a seemingly simple query, but my understanding of JavaScript and JQuery is still in its early stages. The predicament I currently face involves retrieving JSON data from an external server where the information undergoes frequent ch ...

Avoid displaying identical items when rendering a page from JSON data

I am using ajax and json to render a page. The structure of my json is as follows: {"status":"ok","rewards":[{"id":201,"points":500},{"id":202,"points":500}]}. I want to load the data using ajax only once if 'points' have duplicates in any of the hashes. ...

Configure the IIS HttpCompression settings to compress only JSON responses, specifically those coming from asynchronous JavaScript and

I've been tinkering with the "applicationHost.config" file located in the directory "C:\Windows\System32\inetsrv\config." Everything seems to be going smoothly, but I just want to confirm something: <httpCompression directory=" ...

The visibility of the AmCharts' OLHC chart is compromised

Here is my unique StockGraph object: "stockGraphs": [ { "id": "g5", "title": "anotherText", "precision": 4, "openField": "open2", "closeField": "close2", "highField": "high2", "lowField": "low2", ...

Issues with displaying results from a local JSON file using Angular 4 services seem to be

I have developed a User.service.ts service where I have implemented the following code: getContactDetials(){ return this.http.get(this.config.apiUrl + 'assets/data/contact-details.json') .map(response => response.json()); } However ...

Initiate the process of displaying data on a datetime chart using Highcharts

I am currently developing a yearly chart, but I've encountered a small issue. The chart begins in January, however there is no data available until May. The client specifically wants the chart to only display when there is data available, and unfortu ...

Comparison of performance between serializing an object to indexedDB and using JSON.stringify

I am curious about the efficiency differences in terms of browser/CPU/memory between using JSON.stringify for serialization versus writing an object to an object store in indexedDB. The context for this question is optimizing the process of writing an obj ...

What is the best method for encoding non-ASCII characters in JSON.stringify as ASCII-safe escaped characters (uXXXX) without the need for additional post-processing?

In order to send characters like ΓΌ to the server as unicode characters but in an ASCII-safe string format, I need them to be represented as \u00fc with 6 characters, rather than displaying the character itself. However, no matter what I try, after us ...

Objective C - Organize JSON data into groups

I will attempt to explain my idea and what I hope to achieve. Here is the JSON structure: { "objects": [ { "title": "Title #1", "date": "1446930000" }, { "title": "Title #2", "date": "1437782400" }, { " ...

Methods for accessing data from a Nested JSON in Swift

Recently, I've been working on a project in Swift that involves handling a nested JSON file. The JSON data is structured with categories and exercises within each category, as shown below: { "categories": [ { "cat ...

Struggle with Transmitting Information in Ionic 2

I have been working on an Ionic project that involves a JSON file with preloaded data. The initial page displays a list from which a user can select an item to view its content. However, I am encountering a "Response with status: 404 Not Found for URL" err ...

Tips on working with an array received from a PHP script through AJAX

I've been stuck with this issue for the past few hours and I'm hoping to find a solution here. What I'm attempting to do is something like the following: PHP: $errorIds = array(); if(error happens){ array_push($errorIds, $user['user ...

Troubleshooting JSON parsing issues in PHP

In reference to the discussion at: , where suggestions mainly revolved around JavaScript. Is there a specific function in PHP that can be utilized to address the issue described below and ensure that the output is valid JSON? Please note that using front ...

Parsing large numbers in JSON data using the json_decode function

Facing an issue while decoding a json string The PHP version being used is 5.4.4-7 and the operating system is Debian amd64. Here is the JSON string: {"status":"success","account":{"buy_title":"KGP ID","birthday":0,"sex":0,"phone_number":"","avatar":"ht ...

"Troubleshooting: Handling null values in a web service when using jQuery

The API located at http://localhost:57501/api/addDatabase contains the following code snippet: [System.Web.Mvc.HttpPost] public ActionResult Post(addDatabase pNuevaConeccion) { pNuevaConeccion.insertarMetaData(); return null; ...

json_extract_scalar is failing to retrieve a value from a JSON string that contains single quotes

I have a record in my Athena database that contains a JSON string as follows. {'is_referred': False, 'landing_page': '/account/register'} When attempting to extract the value of landing_page using the query below, it returns a null value. select json ...

Sending AJAX information to multiple pages

I have created an HTML page where I am struggling to pass two variables using the POST method to a PHP page. The PHP page is supposed to accept these variables and then call an API to retrieve data based on them. However, my challenge is in receiving this ...

Tips for retrieving the value sent via an AJAX $.post request in a PHP file

Here is an example of my Ajax call: var keyword = $('#keyword').value; $.post("ajax.php?for=result", {suggest: "keyword="+keyword}, function(result){ $("#search_result").html(result); }); In the PHP file, I am trying to retrieve the ...

Utilizing AngularJS to include information into JSON-LD

As a newcomer to AngularJS, I find myself stuck in one of my projects. My goal is to convert the user-entered data in a form into the format: << "schema:data" >> and then push and display it within the @graph of the json-ld. Here are my HTML and Angular co ...

An error occurred in retrieving the server side props: Unexpected character '<' found in JSON data at position 0

I am currently working with next.js and I am trying to retrieve data from my data1.json file using getStaticProps(). However, I am encountering an error: FetchError: invalid json response body at http://localhost:3000/data/data1.json reason: Unexpected t ...

Refresh the datatable using updated aaData

How do I automatically update the Datatable with new Json data? POST request is used to receive data, which is then sent to the LoadTable function in order to populate the datatable. function initializeTable(){ $("#submitbutton").on( 'click', ...

Looping through a Map in JSP containing a nested List of lists of Strings

Looking to loop through a Map<String, List> in Java: final JSONObject mappedData = new JSONObject(); final Map<String, List<List<String>>> associatedUsecasesMap = new HashMap<String, List<List<String>>>(); // Code ...

Exploring deep within JSON data using jQuery or Javascript

I have a substantial JSON file with nested data that I utilize to populate a treeview. My goal is to search through this treeview's data using text input and retrieve all matching nodes along with their parent nodes to maintain the structure of the tr ...