[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x

JSON

580

Solutions

610

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.

Share tech news, updates, or what's on your mind.

Sign up to Post

hello,
how can pass array value in postman.
option={"227":"19","228":"24"}
0
Free Tool: SSL Checker
LVL 11
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I have a Google Sheet with responses from a questionnaire to several people. One question was Post Code, so I now have a Map in Google Fusion Tables showing where they're all located according to Post Code.  That's all working fine, but my question is about the Info Window.  I've customized that to a certain extent, so now it only shows the fields that I want. But what I want to do is...

a) For some fields (checkboxes), only show it and associated data if the data is non-empty.

b) For other fields (multiple choice grid where the left column of the grid is 'None'), only show it and associated data if the data is NOT EQUAL to 'None'.

I've searched a lot in forums about this, and I've found many answers that use 'if' statements, but I can't get anything to work. Every time I use the curly brackets {} it thinks I'm trying to specify a column name, so I get 'Unrecognized column' every time I try using {if ...} or {template .contents}, or anything apart from {a name of one of my columns}.

Also, I've seen a lot of references to $data.value.name - but nothing that explains how I modify this to include the actual name of my column.

First of all, since (b) should be simpler, could you help me with that one first?

Thanks.
0
Hello Experts,
Any safe Windows application or plugin to convert a CSV file to JSON. Please note I cannot use solutions online as I am handling confidential data and cannot upload it. Appreciate any suggestions.
0
I wanted to parse a binary value and store it in a blob column in a database.
Input is a JSON format,


I have tried using the below code, I am getting error (Invalid LOB Locator) on the below line

DBMS_LOB.CONVERTTOCLOB ......
 

Below is my anonymous block used in apex rest service.

DECLARE
L_PROFILE_X BLOB;
--Can only read body once as BLOB (this package assumes a base 64 encoded string)
v_body_blob_1 BLOB ;
v_body_blob_test BLOB ;
--BLOB for binary image and CLOB for base 64 encoded
v_image_blob_1 BLOB;
v_clob_1 CLOB;

--CLOB Conversion Parameters
l_src_offset_1 NUMBER := 1;
l_dest_offset_1 NUMBER := 1;
l_blob_csid_1 NUMBER := DBMS_LOB.DEFAULT_CSID;
l_lang_context_1 NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
l_warning_1 NUMBER;
l_amount_1 NUMBER;



--Can only read body once as BLOB (this package assumes a base 64 encoded string)
v_body_blob_2 BLOB ;

--BLOB for binary image and CLOB for base 64 encoded
v_image_blob_2 BLOB;
v_clob_2 CLOB;

--CLOB Conversion Parameters
l_src_offset_2 NUMBER := 1;
l_dest_offset_2 NUMBER := 1;
l_blob_csid_2 NUMBER := DBMS_LOB.DEFAULT_CSID;
l_lang_context_2 NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
l_warning_2 NUMBER;
l_amount_2 NUMBER;

 
BEGIN

L_PROFILE_X := :body;

for i in 
(SELECT id,hosted_by,episode_guest,link,go_live_description,logo_image,mime_type_logo,bg,mime_type_bg
 FROM json_table
 (L_PROFILE_X , '$' 
  COLUMNS 
  (id  NUMBER FORMAT JSON  PATH '$.id',
   hosted_by  NUMBER FORMAT JSON PATH '$.hosted_by',
   

Open in new window

0
Hi,

From what I know, if you are documenting a data structure (e.g. JSON) with embedded objects, you might have something like this for the data schema tables:

DISCLAIMER: In the real world, I doubt you'd have a full (e.g.) doctor object embedded in the prescription object. More likely, you'd have a record number for patient, doctor, drug, but the below is useful for this example. :)

PRESCRIPTION OBJECT
Date
Time
Rx Number
Patient Object
Doctor Object
Drug Object
Directions
etc.


You'd then have tables for the aforementioned objects, which themselves could contain objects:
DOCTOR OBJECT
LastName
FirstName
IdNumbers Object
Address
etc.

And in turn...
ID NUMBERS OBJECT
Licence
DEA
NPI
-----------
Now, to the question. I'm documenting an API where some of the embedded objects contain only one field/object. To use the above example, something like:

PRESCRIPTION OBJECT (as before: contains many fields/objects)

DOCTOR OBJECT (Contains one object)
IdNumbers Object

ID NUMBERS OBJECT (Contains one field)
License

Per the above, would I be overdoing it to have separate data tables for these objects containing only one field/object? If so, I'd need to find a clean way to embed everything in the parent table.

Thanks!
Steve
0
I have a project with a TON of DLL's in the Bin Directory.

One of the DLL's used is NewtonSoft JSon

several of the other DLL's reference it but one or more require a (lower) version of the NewtonSoft

Is there a way to determine which ones are dependent on NewtonSoft AND what version they are requireing?
0
Hi,

I know I have to use json_decode, but I am having a few issues getting to the id (i bolded the value I want.
{"message":"Request submitted","sms":[{"destination":"61402XXXXXX","from":"XXXXXXXXXX","id":"d3c2183dbbb9895386ffd3d234f90421","receipts":{},"message":"Hi, Please contact CCC","uri":"\/2016-11-30\/sms\/d3c2183dbbb9895386ffd3d234f90421","created":"Fri, 01 Dec 2017 11:31:14 +0000"}],"api_version":"2016-11-30","status":200,"uri":"\/2016-11-30\/sms"}

This is what I have so far, but none of it is really effective.
$Callresult = json_decode($response);
$Callresult2 = json_decode($response,True);
echo "<br><Br>Call Result <br><br>";
var_dump($Callresult);
echo "<br><Br>Call Result 2<br><br>";
var_dump($Callresult2);
echo "<br><Br>Message: ";
echo $Callresult2->message."<br><br>";
//print_r($Callresult);
//echo("<br><Br>Status Testing: <Br><br>");
//$xmlresult = "";
$Callresult = $Callresult;
echo "<br><br>Response1:".$Callresult;
echo "<br><br>";
$Callstatus = $Callresult[0]->id;
echo "<br><br>Response2:".$Callstatus;

is anyone able to assist?
0
Hi Experts,

How Do I Call PHP from JS/JQuery?  I'm thinking AJAX?

A common example is "Load More Results", where without refreshing the page, I use a jquery listener to call a PHP function (or, if I cannot be as specific, then a PHP page), that would return to the JS a JSON object.

In theory, this should  be  possible with AJAX, but how? as well, how wold I stop everything else from firing until this process is complete.

Thank  you!
0
Hello - I'm trying to learn a bit about using Angular. I have a specific learning exercise I am trying to figure out.

I am super new to Angular. I have been working with one of the tutorials on the Angular site in my down time over the last day or so...but very new to using it.

My main question for this thread is working with/trying to create an Angular table. Specifically one structured similar to the layout for the code below.
<table style="width:75%">
  <tr>
    <th>Firstname (e.g. Static Field Label)</th><td>Clark (e.g. firstName pulled from JSON file)</td> 
    <th>LastName</th><td>Kent</td>
  </tr>
  <tr>
    <th>Job</th><td>Reporter</td>
    <th>ID</th><td>94</td>
  </tr>
 
</table>

Open in new window




I am not seeing a lot of examples with a table structured similar to this (where its more of a profile grid instead of a straight list of data.

*Two other bits of functionality I will be researching for the table is to pull the info to be displayed from a JSON file.
*A search box to determine which record to display in the profile grid using an ID field.

Here are some sample values for the JSON file:

[
       {
           "firstName": "Clark",
           "lastName": "Kent",
           "job": "Reporter",
           "id": 20
       },
       {
           "firstName": "Bruce",
           "lastName": "Wayne",
           "job": "Business Owner",
           "id": 30
       },
       {
           "firstName": "Peter",
           "lastName": "Parker",
           "job": "Photographer",
           "id": 40
       },
       {
           "firstName": "Tony",
           "lastName": "Stark",
           "job": "Business Owner",
           "id": 25
       }
   ]

Open in new window



Any tips or suggestions to get me pointed in the right direction would be greatly appreciated!!

Thanks,
0
I have an app where I do a $.ajax and do a get call to an API, which returns a previously converted excel file (excel to base64); I need to re-convert this base64 data back into it's original form - i.e. into Excel file. I tried retracing the steps I took to convert the excel into base64, reversing some of them, but I'm not able to generate the original file. An excel file IS being generated, but it still has base64 data and therefore opens w/ errors and in a corrupted state. Has anyone else successfully done this?

Below is my code and fiddle link: (I didn't add the base64 json data (responseData) here since it's large, but it's on the fiddle)

var bindata = window.atob(responseData);
function DownloadExcel() {
  window.location.href = "data:application/vnd.ms-excel;base64, bindata"
}
var blob = new Blob([responseData], {type: 'application/vnd.ms-excel'});
if (window.navigator && window.navigator.msSaveBlob) {
    window.navigator.msSaveBlob(blob);
}
else {
    var objectUrl = URL.createObjectURL(blob);
    window.open(objectUrl);
}

Open in new window



Fiddle link: https://jsfiddle.net/damon_matt/2ofz6xrd/14/
0
Free Tool: ZipGrep
LVL 11
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

I am currently having an issue with the chrome GPO ManagedBookmarks. I have tried doing this through the Group policy and through a GP Registry file. Chrome shows that there is a managedbookmarks policy if i go to chrome://policy.

Capture.PNG
The json is showing as empty when it is not.

I have tried the example JSON from here.
https://www.chromium.org/administrators/complex-policies-on-windows

Got any ideas.

Thanks
0
I would like something like:

My list
       Item 1
       Item 2
       Item 3  

Here's my current non-indenting code
     {  
      "type": "paragraph",
                  "content": "The following have limitations on the amount that can be claimed:",
                  "listofitems": [
                        { "itemtext": "my text her" },
                        { "itemtext": "my second line of text" },
                        { "itemtext": "my final line of text" }
                  ],
                  "listunstyled": false,
                  "isunordered": true
            },
0
HI,
I am using     private static final ObjectMapper mapper = new ObjectMapper();
and trying to do :
        mapper.readValue(value, List.class);
Its giving compile time error: cannot resolve method readValue...
Here my value will be a string liek = ["option1", "option2"]
a json array and i want to convert it to List<String> object.

How should i do it ?

Thanks
0
Could anyone here show me some examples on how I'd interface with this Spark API using PHP (to pull in MLS data)?  

http://sparkplatform.com/docs/overview/api

Thanks,
- Yvan
0
Hi Experts,

Usually when you want to send an email for a webpage you have
<a href="mailto:someone@somewhere.com?subject=Who%20knows">send email</a>

Open in new window


But this would normally trigger the email client on the computer, but how would you do this with Gmail?

This is for a small application and later I will need to add appointments in the Gmail Calendar. I am bringing this up in case I need to have a common setup for both?

Thank you
0
I had this question after viewing jQuery appending new key/value pair to JSON object in a nested loop.

I need help with a javascript function that returns a json object
sheetjs.txt
0
Hi,
Suppose i make a json like {"name" : "xya", "title" :"sample"}
Now suppose someone wants to make this json and send it to the server without the title element.
There are two ways {"name" : "xya"} or {"name" : "xya", "title": null}
Now obviously it is upto the code at server side how it handles. But ideally i feel they should be handled in the same way. Or there is any reason to handle the two different. I mean in a well designed codebase should there be any difference in how this should be handled ?

Thanks
0
I'm using jQuery 3.2.1 for calling an API service using $.ajax (type: "get"). The response object that is returned is in JSON format and is named responseList. I need to compare this to a JSON object that is stored in browser in a hidden field.

I'm trying to compare authorList with responseList, and if there is changed value in responseList for the same element, then populate another JSON object with the element and the changed value, along with another key/value pair to store a message. I'm able to populate the changedList object but the new key/value pair is being created as a new element rather than a new key/value pair WITHIN the element in changedList. Is there a clean way of performing this? Also, there is some error in how the array push() is being implemented in my code, because instead of 2 rows in changedList, I'm getting 15 objects, w/ triplicates of each JSON element. Below is my code:

var authorlist = [{"AUTHOR":"DONNA EDWARDS","COUNTRY":"USA","REGION":"MIDWEST"},{"AUTHOR":"EMERALD JONES","COUNTRY":"UK","REGION":"EU"},{"AUTHOR":"SHAKESPEARE","COUNTRY":"UK","REGION":"EU"}];

var responseList = [{"AUTHOR":"DONNA EDWARDS","COUNTRY":"CANADA","REGION":""},{"AUTHOR":"EMERALD JONES","COUNTRY":"SOUTH AFRICA","REGION":""},{"AUTHOR":"SHAKESPEARE","COUNTRY":"UK","REGION":"EU"}, {"AUTHOR":"JOHN DOE","COUNTRY":"AUSTRALIA","REGION":"APAC"}, {"AUTHOR":"KELLY YU","COUNTRY":"SINGAPORE","REGION":"APAC"}];

var changedList = [];
var messageHeader = "MSG";
var message = 

Open in new window

0
Hi all

I'm just starting my first Amazon Alexa demo and the basics are ok until I try to get the users address back.

I've approved my Alexa to send the full address data and I'm pulling both the deviceId and consentToken and sending them to the given URL with the consent in the headers but nothing comes back at all. If I try via the URL directly I get this message back {"type":"FORBIDDEN","message":"The authentication token is missing."}

I need to grab this information as I'm going to demonstrate a refuse collection lookup which is based on the users postcode and house name/number.

Any advise or assistance really appreciated. Perhaps I've even going about it all wrong.

Thanks
Neil

This is the Intent Schema:
{
  "intents": [
    {
      "intent": "quit",
      "slots": []
    },
    {
      "intent": "next",
      "slots": []
    }
  ]
}

 Sample Utterances
 next item


<?php

/*
Neil Thompson - Demo Alexa Skill
*/

$EchoJArray 	= json_decode(file_get_contents('php://input'));
$RequestType 	= $EchoJArray->request->type;

$usersAddress 	= GetUsersAddress($EchoJArray);
$JsonOut 		= GetJsonMessageResponse($RequestType,$EchoJArray);

$size 			= strlen($JsonOut);
header('Content-Type: application/json');
header("Content-length: $size");
echo $JsonOut;

/*
GetUsersAddress
*/
function GetUsersAddress($EchoJArray){

	$consentToken = $EchoJArray->context->System->user->permissions->consentToken;
	$deviceID = 

Open in new window

0
Keep up with what's happening at Experts Exchange!
LVL 11
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

I have a JSON string that I want to import into a new Access 2016 table.
Please give me an example of how to do this.

JSON:
{"username": "1465", "formal_picture": null, "show_almanac_date_of_birth": true, "payment_start_uri": "", "show_almanac_email": true, "secondary_last_name_main": "", "id": 207080, "custom_fields": null, "show_almanac": true, "first_name": "Pascal ", "show_almanac_phonenumbers": true, "date_of_birth": "1971-07-15", "given_name": "", "has_sdd_mandate": false, "email": "1234567@hotmail.com", "status": "Gast-rijder", "firstname": "Pascal ", "status_id": 1081, "middlename": "van der", "lastname": "mijnnaam", "payment_success_uri": "", "primary_last_name_prefix": "van der", "saldo": 0, "profile_picture": null, "phone_home": {"number_full_MSISDN": "", "number_full": ""}, "address": {"city": "mijnplaats ", "address": "mijnstraat", "zip": "1234AA", "country": "Netherlands"}, "bank_account": {"has_sdd_mandate": false, "iban": "NL11RAB1234567890", "bic": "RABONL2U"}, "secondary_last_name_prefix": "", "show_almanac_addresses": true, "gender": "m", "payment_required": false, "show_almanac_custom_fields": true, "phone_mobile": {"number_full_MSISDN": "31123456789", "number_full": "+31123456789"}, "primary_last_name_main": "mijnnaam", "initials": "P.T.F."}
json.txt
0
I have a series of jquery ajax 'get' calls inside a $.each loop. In order to wait until ALL those 'get' calls are completed, I have a $.when.apply block, which executes once all the results of the multiple 'get' calls are populated into an array of json objects called 'ajaxList'. When I try to output the contents of the ajaxList array of json objects inside the $.when.apply block, I get following jquery error:

jQuery.Deferred exception: ajaxList is not defined ReferenceError: ajaxList is not defined

Following is my code:
//Excel Reader 
    function ExcelToTable(event) { 
        event.preventDefault();
        //show ajax loader
       // showLoading();
      // $(".overlay").show();
      //$.blockUI({ message: '<h1><img src="./images/ajax-loader.gif" /> Processing...</h1>' }); 
        ///show ajax loader

        $('#MainModalWindow').modal({
            keyboard: false,
            focus: true,
            backdrop: 'static'
        });
        $('#MainModalWindow').draggable({
            handle: ".modal-header"
          });
        
          $('#MainModalWindow').on('hidden.bs.modal', function (e) {
            $(this)
                .find("#displayErrors tr td")
                    .html("");
          });
        var regex = /^([a-zA-Z0-9\s_\\.\-:])+(.xlsx|.xls)$/;  
        /*Checks whether the file is a valid excel file*/  
        if (regex.test($("#excelfile").val().toLowerCase())) {  
            var xlsxflag = false; /*Flag for checking whether 

Open in new window

0
I had this question after viewing JSON Terminology - Block or Object/Closer to Java or JavaScript.

Hello again,

I found some JSON similar to the below when running a query:

[
  { 
     time: "15:00",
     temperature: 66
  },
  {
     time: "17:00",
     temperature: 62
]

Open in new window


Is it legal to have an array as the outer entity here? Or, do they need an outer ( } to make it an object? I looked at:
http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf

but can't tell for sure.

Thanks!
0
Hi,
I'm writing an API guide for an application that accepts input - and generates output - in JSON format.

Suppose I have the following (redacted) code:
{
   SSN :  "012-34-5678",
   DOB: "1986-10-27",
   Age: 30,
   name: {
      first: "Daffy",
      last : "Duck"
    },
   Department: "Sales"
}

Open in new window


1. Is this entire entity referred to as a block or object?
2. Same for the name element, which contains first/last name.

Also, is JSON syntax considered closer to Java? Or to JavaScript?  The reason I need to know the latter is that I'm showing code samples in Confluence. While Confluence has a Code Block Macro, it does not come with prepackaged JSON formatting.

Thanks,
Steve
0
Hello All

As you can see from the image below, categorizing my data based on Program Type isn't working very well.  Some of the Program Type values are under the wrong category/section.  See below
categorizing
Here's the code
var jsonData = [{
  "ProgramType": "Construction",
  "Contracts": "27d:bbc1:80db:ea0f:728a:d5db:2651:2681/93",
  "ProjectNumber": "00-438-1489",
  "Award": "Yuan Renminbi",
  "Date": "6/15/2017"
}, {
  "ProgramType": "Construction",
  "Contracts": "ce6b:e4a8:ebb8:8b01:e07f:14f9:8eed:6a6a/11",
  "ProjectNumber": "48-710-7372",
  "Award": "Manat",
  "Date": "8/13/2017"
}, {
  "ProgramType": "Design",
  "Contracts": "dfba:c157:1ec:b60f:4329:91e7:5bdb:316f/114",
  "ProjectNumber": "51-508-3050",
  "Award": "Real",
  "Date": "3/16/2017"
}, {
  "ProgramType": "Study",
  "Contracts": "9c3c:6047:cfc3:1301:b92b:fd6f:87b6:3de7/89",
  "ProjectNumber": "68-285-8596",
  "Award": "Rupiah",
  "Date": "3/21/2017"
}, {
  "ProgramType": "Design",
  "Contracts": "afcf:befe:d329:c6d:8a5e:b528:75b9:9d0b/14",
  "ProjectNumber": "02-108-8005",
  "Award": "Yuan Renminbi",
  "Date": "6/21/2017"
}, {
  "ProgramType": "Commissioning",
  "Contracts": "6e90:bafb:1806:92b7:80aa:911c:b6d7:eadc/32",
  "ProjectNumber": "90-824-1407",
  "Award": "Peso",
  "Date": "9/30/2017"
}, {
  "ProgramType": "Design",
  "Contracts": "b410:353b:d353:1c4d:7924:676:5260:7656/40",
  "ProjectNumber": "70-912-7446",
  "Award": "Denar",
  "Date": "12/13/2016"
}, {
  

Open in new window

0
Hi,

The question below was generated by needing to document a JSON structure, but I suppose it could apply to other data formats as well.

Suppose I have a structure:
{
   name: "John Doe",
   address: "1234 Main Street",
   vitals: {
       hair_color: "brown",
       eyes: "blue",
    },
   DOB: "01-01-2000",
   sex: "Male"  
}

Normally, I'd create a table with one row per data element. But, then I have the vitals block, which contains two data elements. Should I create a separate table for vitals, even though it contains only two fields? And reference it in the main table?

Thanks,
Steve
0

JSON

580

Solutions

610

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.

Related Topics