JSON, or JavaScript Object Notation, is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML.

learn more… | top users | synonyms

4
votes
0answers
37 views

Issue in parsing JSON when special characters are included

I have a Json file which has some special character as below:- { "TXT1": "Tést Data", "TXT2": "can®." }, The Special character (é.®) gives me a error BLOB is not a valid UTF-8 string while ...
3
votes
2answers
51 views

Deserialize JSON Root Array

I'm having so trouble deserializing a JSON stream that contains an array as the root: [ { "object": { "property1":"000000", "property2":"000000" ...
1
vote
0answers
26 views

Is there any different calling JSON directly from visualforce page and javascript Static Resource?

I create one javascript file and call JSON from there.Before I use JSON, I use hardcode data and it works.But I try to load data using $JSON, somehow it does not works.Check the code below ...
3
votes
2answers
53 views

What is the maximum number of records I can send per RESTful API call?

There is a maximum batch size for the number of records returned by an API call. Most of the documentation for the API calls reference including a .json file, and some, like the Update a Record ...
2
votes
1answer
20 views

Passing a Name to customize html field on ExactTarget triggered email from Salesforce

I am sending an exact target triggered email using the salesforce Apex developer. However when a member's name does not already exist on the ET side I do not know how to pass that information to ET. ...
6
votes
2answers
63 views

Checkmarx and JSON.serialize

My Salesforce1 code has been recently run through Force.com Security Scanner (a.k.a. Checkmarx). A stored XSS vulnerability has been found and marked as critical security risk. It boils down to ...
3
votes
2answers
71 views

JSON response parser returning some fields null

I am trying to parse a JSON response from google. All the fields are populating with the exception of 'lat' and 'lng'. Not sure what I need to do to get the coordinates. Any help is much ...
4
votes
1answer
29 views

Issue sending triggered email in exactarget using Apex developer

I am trying to fire an ExactTarget triggered email using the Salesforce developer console. I am now getting the error "Problem initating message send during deserialization of JSON payload" Http ...
2
votes
1answer
16 views

JSON Reciever Endpoint

I'm wondering if it is possible to expose an SF endpoint to the internet that can receive JSON data. Its fairly simple to call out to an external service and retrieve data, but I am wanting an ...
3
votes
1answer
39 views

need a method for json string which contains null value and does not contain attributes{ }

please help me, I need a method for json string which contains null value and does not contain attributes{ }. Here's what I currently have: List<Contact> contacts = [SELECT Id, Name, ...
1
vote
1answer
32 views

Extract JSON from Remote Object

There is remote object var case = new Case({Subject:'Test', Status: 'Open'}); How to get/extract json {Subject:'Test', Status: 'Open'} from case reference? Is there some documented approach like ...
4
votes
1answer
99 views

How to Consume JSON Array in Apex REST API Class : Stuck with deserialization Error

I am giving this below JSON array to a REST API-POST Method : So I can insert Account and Contact, but keep getting an error on JSON deserialization of apex parameter. I don't know how shall i go ...
0
votes
1answer
44 views

Why is my Google request denied?

I am trying to integrate Salesforce with Google textsearch in order to acquire a JSON response with desired information. My request is getting denied and I can't figure out why. Any help is much ...
7
votes
2answers
201 views

Handling Large JSON String Values on Visualforce Page

I'm using amcharts to build graph on a visualforce page. The amcharts's input is JSON. So I parse my object to JSON string using JSON.serializePretty. Using this approach, the graph is built fine and ...
4
votes
1answer
89 views

JSON.deserializeUntyped returns “unrecognized token: 'NULL'”, when JSON token has a null value

We're creating our JSON responses to my salesforce callouts in house, so I'm guessing the issue has to do with how we're representing NULL in the JSON response. Here's a snippet of the response SF ...
1
vote
1answer
37 views

How do I refresh an ExactTarget token using the REST API?

How do I refresh an ExactTarget token using the REST API? Is there any good documentation on this?
1
vote
2answers
43 views

Using a variable for a field name in Json stringify

var payload = JSON.stringify( {"Name__c" : data[i].name, "Email__c" : data[i].email } ); How can I do the above one like below. var nameVar = "Name__c"; var payload = JSON.stringify( ...
3
votes
1answer
94 views

Most efficient way to transform AggregateResults to String, Object Maps

Question: What is the most efficient way to transform aggregate results to string object maps? Constraints: The keys of the aggregated results are unknown. The transformation has to be performed as ...
7
votes
2answers
174 views

Parse JSON into Lead

I'm trying to parse a JSON response and create Lead records from it. The JSON is basically formatted as follows. Note, that this is not the complete data being parsed but is the general format of ...
3
votes
0answers
43 views

JSON.serialize alternative which support more objects like HttpRequest or Schema Describes

Often I need a easy and robust way to convert huge nested data structures into an string. Mostly for dumps, logs and debug. JSON.serializePretty() comes close but does not support all Object types ...
0
votes
0answers
21 views

Tracking Triggered Event on Exacttarget

How can we track Fired Event of Journey Builder? We are firing an event via JSON (insert data, evaluate and send email) and getting "{\r\n \"eventInstanceId\": ...
4
votes
2answers
80 views

JSON.DeserializeUntyped: Can I infer anything from the Object returned?

Given a JSON response from a remote API call, I can use JSON.DeserializeUntyped to get an Object, which can then be cast to another type as needed. For example: String jsonResponse = makeAPICall(); ...
3
votes
2answers
221 views

Simple way to generate object from JSON that return from Google Geocode API?

I receive JSON file from Google API Geocoding.Refer to JSON file here.Is there any other easy way to extract the data from this JSON in Apex?I want to retrieve a state value and result status code ...
5
votes
2answers
247 views

replaceAll() \r\n in a JSON serialized string

I can't get replaceAll to work on the '\r\n' sequence in a JSON serialized string. I am serializing a Map object that contains long textarea fields with newlines. I need to change '\r\n' to '\\r\\n' ...
5
votes
2answers
123 views

How can I serialize an object to JSON without properties that are null?

To communicate with a REST interface on a private system, I need to send a JSON message from a trigger. I have a message object that has some fields, lists and a child object: public class ...
2
votes
0answers
46 views

How to set sort order for report called by analytics api using json/ajax

i try to change the sort order of a report called via analytics rest api. For grouped reports there are sortOrder attributes in the grouping section, but i have to call a tabular report. If i call ...
2
votes
1answer
49 views

can exact target connect to a 3rd party web service?

Can exacttarget be configured to connect to a 3rd party webservice returning a JSON object? I guess there are two questions: - can I cause exacttarget to connect to a 3rd party webservice to populate ...
1
vote
2answers
81 views

How to construct the nested JSON

I am using following code and could you please let me know how to construct the nested json. public String getJsonString() { String str = null; JSONGenerator gen = ...
1
vote
1answer
197 views

How to make the context menu for the below code.

I would like to construct the tree view using the JSON with Two object(Account & Contact). root node is the account id and sub node would be the contact(nested level). Treeview: ...
2
votes
1answer
121 views

Parsing JSON with nesting and Arrays

I'm kinda of new to APEX code and working with JSON and I'm trying to figure out how to parse out nested JSON with Array's. This is a basic pattern of the JSON we have coming into our custom field ...
0
votes
1answer
209 views

How to create new record from jstree using json

I would like to create the record from the jstree using context menu. Please help to resolve my issue: My Code: contextmenu : { "items" : function (node) { ...
1
vote
1answer
143 views

JSON Deserialize Byte Array

I'm porting over a rest client from .NET to Apex and in the class that gets initiated by deserializing the JSON response, there is a byte[]. C# Example: public class MyResponse { public ...
0
votes
0answers
35 views

StreamingAPI response has error

I have StreamingAPI it working properly.It some time response has error at the time response JSON Object as error.The log file response contains error below Wed May 15 08:33:07 MST 2014 : Waiting for ...
4
votes
1answer
148 views

Can AMPScript parse JSON?

Using ampscript to parse an XML feed. Client is switching to JSON. Is there something similar to buildrowsetfromXML for JSON in AMPScript? I am confined to using the members login area and not an ...
4
votes
2answers
346 views

JSON.deserializeUntyped() not parsing the whole JSON

I am trying to parse a complex JSON String using JSON.deserializeUntyped(). It parses the first level elements correctly but the second level elements come back as type ANY, even though I am expecting ...
2
votes
1answer
108 views

Giving new field names in wrapper classes for JSON deserializing

Here is the JSON structure: { "public_index": [ { "index": "wiki_eng", "type": "content" }, { "index": "wiki_fra", "type": ...
3
votes
1answer
100 views

How to remove attributes before JSON is sent from Custom REST Apex?

I get back JSON like the following: { Id = a0Ef0000002TPKVEA4; Name = a0Ef0000002TPKV; attributes = { type = "Market__c"; url = ...
4
votes
2answers
698 views

JSON Exception unexpected character

I am doing a callout to a google script which takes in address and returns back geographic information (lat, lng etc) in the form of JSON string. The problem is that in the returned JSON string " is ...
10
votes
1answer
105 views

Comparison fails when converting Opportunity from/to JSON

I am facing an issue when converting an Opportunity to and then from JSON. If I put that in a test, the assertion fails when comparing both Opportunities. Here is my code: Test case: static ...
0
votes
1answer
372 views

How to Using JSON with visualforce

I'm new on visualforce and JSON, and I have a page that have many inputFields want to insert them by clicking on save, and get them back on click on edit button for example, I searched on google for ...
0
votes
1answer
215 views

possible ways to insert multiple values of the same field

I have an Object with RecordNum, RecordVal, And User__id as a reference .. and a VF page as the following <apex:pageBlock> <apex:inputField value="{!Object.RecordVal}" label="val 1:" ...
3
votes
2answers
252 views

How to retrieve just the text without formatting from a rich text field using JSON?

I am querying a rich text field that contains text information using a public rest service using this method ...
2
votes
2answers
81 views

How get all objects and their fields as Json

By means of Schema.getGlobalDescribe.Values () getDescribe ().getName () can receive names of objects.With Using method getDescribe().fields.getMap() we can get fields of object. It is necessary to ...
3
votes
2answers
192 views

My custom REST endpoint is returning double encoded JSON. How can I make it stop?

Here is my current controller: @RestResource(urlMapping='/monitor') global with sharing class TheController { @HttpGet global static String doGet() { Map<String, Object> ...
0
votes
1answer
509 views

How to get Json response without rest api and parse the response in objects

I need to get json response and parse the response into the object(Without using http callout).I need to have application(class) which can get response from other callback url and parse that response ...
5
votes
2answers
225 views

JSON.serialize is mucking with my datetime objects. How do I fix this?

I feel that the following assertion should be true, but it is not: DateTime testDate = DateTime.now(); System.assertEquals('"' + testDate.format('yyyy-MM-dd\'T\'hh:mm:ss.SSS\'Z\'' + '"'), ...
2
votes
2answers
475 views

Apex Rest JSON serialization Error: Invalid type for Http* method: …Map.Object

Background I'm developing some generics apex web service (Rest). The response should be an standardised json schema like this: { "res": true, "message": "Records Upserted Ok", "data" : ...
2
votes
1answer
100 views

How do I test cover simple JSON creation in a trigger?

I have an contact after trigger which collects data from Contact, add some personal, authentication pairs, and updates a 3rd party system. While the insertion of account/contact in the test class is ...
5
votes
2answers
4k views

How to properly use JQuery Datatable sAjaxSource with Apex providing JSON source

I'm trying to use sAjaxSource with server side processing from Apex class which will provide JSON as source. First I was trying simple example, which won't work and won't output any error (not in ...
2
votes
1answer
200 views

Transform JSON with lists inside into form data in Apex

Is it possible to serialize this JSON to Form-data in Apex? The JSON we received: [{"vendorcode":"4444","startDate":"2014-03-02","client":[{"name":"John"}]}] We need to serialize it to Form-Data, ...