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

0
votes
1answer
22 views

REST API calls from salesforce and parse the JSON to display on the vf page

I have to make REST API call from salesforce to a HTTP URL GET method to get the JSON response parse it and display it on the vf page. My Questions: From the class below how can I check the status ...
3
votes
1answer
103 views

Convert Byte Array/JSONArray to Base 64 String via APEX

We are calling an External WebService that is returning us the JSON Object. In that Json Object they are sending the PDF as ByteArray(JsonArray) not as Base64 String. So am thinking is there a way to ...
1
vote
2answers
29 views

JSON Serialization with nested relationships among multiple objects

I have 4 objects(Account,custom1, custom2, custom3) with the following relationships: Account and custom1 has master detail relation. Custom1 and custom2 has lookup relation. Custom2 and custom3 has ...
2
votes
1answer
72 views

Handling hyphens in JSON deserialization

I am trying to use public REST API that that has hyphens in variable names. Apex does not support variable names with hyphens. JSON2Apex tool generates kind of strange class as well. I was facing ...
2
votes
1answer
34 views

JSON Serialize vs JSON Generator

I have a build a REST API @HTTP POST using apex class and I was able to serialize the account info for the specified columns. @RestResource(urlMapping='/test/Netsuite_api/*') global class ...
0
votes
0answers
37 views

Removing a duplicate element from a JSON Array

I'm trying to figure out a way to dedupe JSON arrays based on the _prop.Invoice_Number__c value returned by a Remote Object retrieve. Please see attached screenshot of the JSON as viewed through a ...
0
votes
1answer
19 views

Calling JSON.deserialize() throws “System.NullPointerException: Attempt to de-reference a null object”

I'm trying to use the System method JSON.deserialize(jsonString, apexType) to deserialize the body of an ApexRest POST request. My code compiles, but at runtime I'm getting a ...
1
vote
1answer
22 views

change JSON array to normal form

I have the below JSON POST callout class. The data is sent in an array format whereas the destination requires it in just normal format. please suggest to remove the array in this code an execute in ...
0
votes
1answer
52 views

Parse nested JSON

I need to parse this JSON, and then insert the values into a parent object, and then a list of child objects into the detail page of the parent. I'm having trouble with a few issues: I am unable to ...
0
votes
1answer
22 views

JSON single quote exception while testing REST service using Postman client. Any suggestions?

While testing a REST service i am getting a JSON parsing exception as given below. [ { "errorCode": "APEX_ERROR", "message": "System.JSONException: Unrecognized character escape ...
1
vote
0answers
28 views

Trigger send emails from SF CRM vs, SFMC

Situation is having a SF CRM in place where a JSON call is kept at the lead/contact level. This JSON is requested by a CMS to change a website. When triggering an email of the SFMC Contact or Lead ...
1
vote
1answer
54 views

Sending a rest callout using JSONGenerator?

I am triying to send a callout using JSONGenerator in salesforce but I am having difficuty in putting the things through using .write methods. Any help will be great. { "request" : { ...
3
votes
1answer
124 views

Parse JSON Response and add to Visualforce Page

I have this JSON Response, and I'm having trouble trying to figure out both the JSON.deserializeUntyped and JSON Parser. My ultimate goal is that I need to parse the JSON, then take each value and ...
1
vote
1answer
27 views

Replace original record with another on during After / Before Insert

Imagine the user clicks a standard New button of a custom objects, populates some fields (in a Standard Layout) and then clicks save. He then is redirected to the View page of this new record, but is ...
2
votes
1answer
17 views

Get tab delimited data from the XML node

I am doing a web service call and get XML response back. I need to extract the data within the XML node and create a map out of it. The issue is not the XML but the way the data is present in the ...
0
votes
0answers
42 views

Export Parsed Data To CSV Format From Visualforce?

I re-titled this so as to make it simplaer in concept - JSON is not directly the issue, it's the ability to export data that appears in a VF page. We have a situation where, when Leads (or Accounts) ...
1
vote
1answer
24 views

How to access the get; set of a inner class after using JSON.deserialize in salesforce apex

So I am getting a response as jSon for which I created the class: public with sharing class TurboBrigeResponse { public responseList responseList{get;set;} public String authToken{get;set;} ...
2
votes
1answer
58 views

JSON String to custom object list

Here is breakdown of what I am trying to achieve Read List of questions from a file uploaded by user Convert it into JSON format Create a List of custom object Insert this list into database I ...
0
votes
0answers
18 views

HTML Dependent dropdowns based on a Data Extension data from the Marketing Cloud

I am trying to create a Marketing cloud microsite with dependent dropdown lists. The information is store in a Marketing Cloud data extension. I am not able to make it work. This is sample of code: ...
1
vote
1answer
39 views

What should be a good aproach to retry a web service callout?

Today i recived an exception mail saying this : Exception Message: Upsert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: [] ...
3
votes
3answers
210 views

How can I write a valid JSON format when I want to pass variables in it?

Following is the valid JSON format: String json = '{'+ ' \"A\": \"Value of A\",'+ ' \"B\": \"Value of B\",'+ ' \"C\": \"Value of C\" '+ ...
1
vote
0answers
42 views

Best way to parse “stringified” (sub-)Map<String,String>

In my Auth Provider RegistrationHandler, I received an instance of the Auth.UserData class, filled with users data (in this case it is an external Salesforce user). The usage is very comfortable, as ...
1
vote
1answer
62 views

JSON Unexpected character ('P' (code 80))

I'm working with JSON and I got this error when the page deserializes it: Unexpected character ('P' (code 80)): was expecting comma to separate OBJECT entries at [line:1, column:4074] I write you ...
0
votes
1answer
31 views

Encrypting the JSON request send to external system

Just want to know , if there is way to encrypt the json request that we send to external system. I am integrating with few on-premise external systems and there is ask for encrypted json request from ...
2
votes
0answers
95 views

Remove leading and trailing white space from dynamic JSON in angularjs

I am facing issue while fetching JSON string dynamically using angularjs. Here is one instance where I am facing this issue - If a user enters any value on the UI in a textarea as follows: ...
2
votes
0answers
36 views

My VF page is loading both Mobile & Desktop view

I am using JSON to populate data tables in my page. very Strangly, it's loading the data in both Mobile & Desktop view. Can anyone help me with this? Attaching the screen shot. PFB the code ...
3
votes
3answers
442 views

How can data be extracted from this kind of JSON format?

How can "orderDetails" be extracted from the following JSON payload? { "itemId": "111", "count": "20", "bookOrders": [ { "bookName": "book1", ...
5
votes
2answers
168 views

Deserialize JSON Array With Integer Index

I am trying to avoid having to do a JSON deserialized untyped, but not sure if I can... I get back a response of contact data from a third party that looks something like this: {"data": { ...
4
votes
2answers
64 views

Can you send json from VisualForce to Apex and have it be valid?

I have this JSON object that I've gotten from the front end. I want to send it to Apex and finally send it to my external API. Visualforce: ct_4_sf.RecordingTest.saveVideo( data, ...
2
votes
1answer
60 views

Triggers & JSON!

I am trying to run a future method from a trigger. As the future method takes only primitives as parameters, i am serializing the Trigger.new to pass it to a future method. I am deserializing the JSON ...
2
votes
0answers
30 views

Am I doing it right with this function sforce.interaction.searchAndScreenPop

We are new to SalesForce integration and we are up to integrate our company softphone with salesforce. We are using the sforce.interaction.searchAndGetScreenPopUrl for popping up the matched object. ...
3
votes
1answer
51 views

Display List of Objects in a VF page not working as expected

To put you on perspective, I've created a Detail Page Button that displays in a new window some result data from a callout to a SOAP web service. The thing is, I've tried it in a sanbox, and it works ...
1
vote
0answers
49 views

Google Timeline Rerender problem

I'm trying to include Almende's Google Timelines (Link to documentation) and I'm having some trouble rendering the timeline after the first time. I'm using JSON to fill in the data which is computed ...
0
votes
0answers
39 views

JSONGenerator writeObject() generates private properties

I have an Apex Class with some public properties and some private properties. When I use JSONGenerator.writeObject(foo), private properties are written into the JSON string. My code is below. public ...
2
votes
1answer
123 views

Storing JSON response in SF text field gives '&quot;' instead of double quotes (")

For debug purposes, I'm trying to write the JSON body returned from an HTTP callout into an SF text area field. My problem is, despite the JSON body being stored as a string variable, and despite it ...
0
votes
0answers
25 views

Continuous Webservice call from Developer sandbox to QA sandbox

We wanted to implement a functionality that would fetch data from QA to Developer sandbox for testing purpose. For this: I created a VF page that has only two fields, the first dropdown shows the ...
3
votes
1answer
128 views

System.JSONException: Apex Type unsupported in JSON: Object

I was trying to parse json to apex but i was getting System.JSONException: Apex Type unsupported in JSON: Object My apex code was public class patdetils77 { //public String strBody{ get; ...
1
vote
1answer
103 views

Deserialize JSON to Map - EchoSign REST API response help

I am making a call to the EchoSign REST API and I need to get the signing URL of the most recently signed document using an EchoSign query. I am using the following: HttpRequest req = new ...
2
votes
1answer
235 views

Access sObject list variables in Javascript

Question: I need to create list of sObjects in Javascript. Let's assume accountWrapperList is a list of (Account + checkbox) defined in controller. You can access this list in your javascript if you ...
1
vote
1answer
69 views

POST /validateEmail - How do we utilize this function with only JavaScript/JSON/JQuery?

I have a need for using the POST/validateEmail to do client side ajax validation on an email address prior to submitting data from a webform/webcollect to a data extension. source: ...
1
vote
0answers
53 views

Return success message or error message from AMPscript

I´m constructing a form to get new emails from my website. The form works fine, all fields are recorded at data extension. :) But i have problems to return the success message or error message from ...
5
votes
1answer
181 views

How to build a Apex Class to handle a JSON format in my example

I want to build a custom sync framework and combine serval object's data to a Json string. For example List<Account> accounts = [select Id, Name, ... from Account where ...]; The sOBject is ...
0
votes
1answer
124 views

I am not able to parse string as it needs double quotes format

Please find the code. Apikey= ApexPages.currentPage().getParameters().get('Apikey'); jsonstring='{FirstName:"}'+Apikey; public void parseJsonString(){ JSONParser parser = ...
1
vote
1answer
135 views

Salesforce System Error

I'm getting FATAL_ERROR System.UnexpectedException: Salesforce System Error: 2029807441-269060 (565110838) (565110838) From this code: The line that throws the error has a comment next to it. ...
2
votes
1answer
49 views

How do I access elements from Json?

If I do String json = api.doRetrieve(endpoint); then I get back a json string. This is an array of objects. How do I get it to where I can do obj.someproperty in Java and access it? I'm doing this: ...
1
vote
1answer
97 views

Sample 3rd Party APIs to practice Salesforce Apex callouts

Are there any sample 3rd party APIs that I could make use for practicing Salesforce Apex callouts.
2
votes
1answer
71 views

Triggered Send - passing nested data

Is there any good solution for sending nested (not flat) data to triggered send? Suppose I want to send a transaction confirmation email. Ideally, I would like to send a json (or json-like) object ...
6
votes
2answers
89 views

Is there any logic to how SFDC serializes classes to JSON?

I'm working on documentation for a number of APEX REST API endpoints which returned user-defined types. I'm struggling to write the documentation since the order of how things are serialized into JSON ...
0
votes
1answer
26 views

parsing JSON to class and transforming on-the-fly

I have an @RestResource listening for a JSON string to be passed to me. I then use a JSON2Apex class to parse the JSON into a usable format. However, I receive dates in "seconds", an example of ...
0
votes
2answers
217 views

Deserialize nested JSON

I'm trying to deserialize a nested JSON string and store the values so that I can insert them into a visualforce page. Something like this tutorial here. However, I'm getting the error ...