Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [json]

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.

0
votes
2answers
49 views

Parse JSON with Apex

I am trying to deserialize below JSON . Problem is that sometimes message is returned as an object and sometimes as an array . In this JSON , I have combined three HTTP responses into one so as to ...
0
votes
0answers
11 views

Bindings measures from two datasets in Einstein Analytics

I've got a problem. I'm trying to display the "%" in my number widget. It's easy with only one dataset but in my case I got two datasets. I want to take the budget value from Budget and sales value ...
0
votes
0answers
27 views

How to parse json string in map or list [duplicate]

Please help for parse json response. My json String is { "result":[ { "parent":"", "made_sla":"true", "caused_by":"", "watch_list":"", "...
0
votes
2answers
39 views

Access field values from JSON String in Lightning Component controller [on hold]

PFB Code. I want to validate few fields before save but not able to fetch field values from JSON string. saveFunction:function(component, event, helper){ //Production Year Details/...
0
votes
1answer
41 views

Search/Filter functionality in a lightning table without using jquery. Response from server side will be json

Json response: {"rows":[{"vals":[{"val":"Abc Corp","cssClass":""},{"val":"GROUPA","cssClass":""}, {"val":"Eitan","cssClass":"responsiveHide"}, {"val":"9","cssClass":"responsiveHide"}, {"val":"$18.9K",...
-1
votes
1answer
41 views

Access value of JSON in JS Controller [duplicate]

I received value from Apex as, {"data":{"Id":"a002E00000ZKKbGQAX","Name":"FCS Group","Frequency__c":"Monthly",}} and I want to fetch the value of frequency, Below is the code I tried, this.strtest=...
0
votes
0answers
25 views

Why salesforce remote action response wrapped in extra keys?

I am calling simple remote action, and returning a response object, in my object I don't have any properties like "s" and "v" but they still appear in my raw json response. I am not sure whether ...
1
vote
1answer
73 views

JSON DeSerialization Help?

I am currently working on an integration with other systems and I have the JSON coming back in the below format. { "searchDocumentsResponse": { "documentsIndexInfo": [ { ...
1
vote
2answers
40 views

Send custom data (100k) to a Canvas URL

I am planning on using Canvas to lightweight integrate an external web app. In the documentation (https://resources.docs.salesforce.com/218/latest/en-us/sfdc/pdf/canvas_framework.pdf) I wasn't able to ...
2
votes
2answers
59 views

First “0” is missing when displaying a number starting with “0”, with GTL

I need to display numeric value in transnational email. I'm parsing json with GTL. Some times the payload can have a value like 012345, but in the email the display is 12345. I tried to format with ...
-1
votes
1answer
22 views

Validation on fields results by a SELECT query

I need to make a validation of the results query of many fields. Today this validation is being made one by one, in such effort that, in my opinion, could be less if we used a function and a list or ...
0
votes
1answer
35 views

String parse to Date yymmdd

I wrote a question below : String parse to Date yyyymmdd But now I'm facing a new similar question : What if I want to parse a string yymmdd to a date? for example : 190503 instead of 20190503. ...
-4
votes
1answer
60 views

“Illegal assignment from Object” error

global class CasePRBugzilla_RestService{ global class cpb { public string Batch; } global class RecordIDS { string vmstarid {get;set;} string gsid {get;set;}...
0
votes
0answers
38 views

Call a field inside a class dynamically

I have a JSON that I get as a webservice and deserialize it into classes. The classes are : public class DataStructure{ public String Name; public String Code; public String ...
0
votes
1answer
24 views

Best Structure for Multiple Sub Classes

I have a JSON string of which I always know 2/3 of the structure will be the same, but the last third will be different based on the source. I want to try to build structured types for this in apex so ...
0
votes
1answer
44 views

Convert hierarchically structured JSON data into a list of sObjects Contact

My webservice contains hierarchical data so that I cannot transform it into an sObject when making the GET request. Here is an example for Contact, but the phone number is grouped so that I cannot ...
0
votes
1answer
26 views

Restructure hierarchical data in a REST callout

I found contact data as JSON on the web that is not organized as the Contact sObject as the phone number is being stored as hierarchical data: please see https://api.androidhive.info/contacts/ for the ...
0
votes
1answer
43 views

String parse to Date yyyymmdd

I need to parse a string that I got from a json to date while the value of the string is in the next format: yyyymmdd - for example 20190429. Is there another simple way to do it instead doing ...
0
votes
1answer
20 views

Wrong format of JSON Array after a successful POST using Apex Class

I've been trying to create a List from the Account object, filtered by their record type, to be sent to our website using the Apex Class. I managed to create the query correctly and it returned the ...
0
votes
1answer
45 views

JSON response structure change

JSON response from the callout is changed. 1) Current JSON response : { XYZ { } DEF { } MNO { } } Now its changed to : { ABC_Stage{ XYZ{ ...
0
votes
0answers
39 views

Get previous year date of today

I would like to compare the revenues from the previous and current year but not all the previous year. I want to compare until this date. I have something like that : q_A = filter q by date('...
0
votes
1answer
68 views

How to parse JSON in apex from lightning component

Following is the JSON structure. I want to deserialize this data structure in APEX to Update the Records, sobject is dynamic not every time 'Contact', I am confused how deserialize this data ...
1
vote
1answer
37 views

How is JSONParser object structured / stored? [closed]

I am exploring the JSONParser methods and trying to understand how its objects are structured and stored in Salesforce database. Here is my JSON string - String input = '{"name":"paulo","age":42, "car"...
0
votes
1answer
41 views

Passing a JSON parameter from test class to class method

I have a class which has a method with a parameter of JSON type. Now my goal is to create a Test class to test the method with the parameter of JSON. Please see my codes. This is my method in my ...
0
votes
0answers
18 views

Unable to parse unicode characters as a string anymore

A few week ago, my api code that parsed a String just fine, all of the sudden doesn't work when the passed in string is unicode characters.. Here is my code: class Degree { String title; } class ...
0
votes
1answer
25 views

JSON structure in Salesforce?

How would i store this kind of JSON structure in salesforce? "elementOne": [ { "itemOne":"valueOne", "itemTwo":"valueTw0", "embeddedElementOne":{"embeddedItemOne":"embeddedValueOne"}, ...
0
votes
0answers
14 views

Not return correctly Json in Method GET Apex, return error page in html

I decode a Json in a Get method via PHP and php returns the answer in correctly Json, however in apex it returns me a page with an error in html, but with the Status Code 200. My client programmer ...
3
votes
3answers
490 views

JSON.serialize: is it possible to suppress null values of a map?

I tried to serialize a map with null value (api 45): Map<String, String> bodyMap = new Map<String, String> {'key'=>'value', 'key2'=>null}; System.debug(JSON.serialize(bodyMap,true));...
1
vote
1answer
445 views

Explicitly parse JSON string vs JSON.deserialize

The JSON2Apex web tool offers 2 methods of parsing of the JSON string: one uses JSON.deserialize method, and the other creates parser and iterates over the input json. The second option can be enabled ...
1
vote
1answer
14 views

Get value from deserialised JSON

I have a JSON string which looks like this: jsonstring = {"XX":["Blah blah"]} I need to get the 'Blah blah' into a string variable. How do I do this? Tried doing it this way, but all that returned ...
1
vote
1answer
68 views

Dynamic UI based on Large JSON response / Web UI based on JSON Schema implementation [closed]

I'm dealing with a complex problem and need expert opinion for selecting a right approach. In short, Need to render a Dynamic UI based on JSON returned by an external system. Each user selection ...
0
votes
1answer
23 views

Bind the Result of one dataset to an another

I have two steps. One with my Holidays group by years and month created with a single dataset with one column "Holidays" with all date of holidays in 2018 and 2019. The second one is my Amount per ...
0
votes
1answer
42 views

How to serialize a custom Salesforce Class object with nested objects to json

I am a noob on serialising in SF. I have a SF object which i Want to serialise to JSON. The object contains nested data. Do I need to create all the nested data first an add these to the outer ...
0
votes
1answer
37 views

How to get value from object Json.deserialize

I have deserialized a JSON object as follows: MyObjects MyA = (MyObjects) JSON.deserialize(req.requestBody.toString(),MyObjects.class); When I do MyA.get('Accounts') my result is as follows ({...
1
vote
2answers
64 views

API post call returns lots of addition text

https://api.ivr-platform.com/api/token-auth after submission this doesn't return just the json object but the entire webpage with a json object in the text. public without sharing class ...
1
vote
1answer
204 views

Convert JSON to Map

I want to store key and value for the following json dynamically. Key as "01u9000000Ag0bbAAB" and value as "203" String input = '[{"01u9000000Ag0bbAAB":"203","01u9000000Ag0bZAAR":"23","Id":"...
1
vote
2answers
46 views

Comparing records from Data extension

I have a weird situation, I need to check a value in an Data Extension and if the value is not there, I need to update another data extension. But if the value is there, the data extension should not ...
1
vote
2answers
146 views

How to be able to process a large JSON response?

We're calling an external REST service from Salesforce and are receiving a JSON response of more than 45 MB. Has anyone attempted anything like this?
0
votes
1answer
79 views

GTL and multi nested JSON

I need to send an email and update a data extension based on JSON content. I've written code combining GTL and AMPscript but I keep getting errors. And also since this is my first time using GTL and ...
2
votes
1answer
33 views

How to advoid Unknown field: MyJSON.number

I am having trouble with deserialising a jsonstring. In my debug I get the error System.JSONException: Unknown field: MyJSON.number. As number is a reserved field in salesforce I replace it with ...
0
votes
1answer
40 views

JSON generation in apex batch - how to correctly configure cc in email sending

Below is my code that my batch calls to create JSON to call and send emails through sendgrid. I am trying to loop through the list of contacts and add them to the CC object's array. i have attempted ...
0
votes
2answers
29 views

How print return value in debug - return (WS_BankStatementResponse) System.JSON.deserialize(jsonReplacedString, WS_BankStatementResponse.class);

public static WS_BankStatementResponse parse(String json){ String jsonReplacedString = json.replace('"date":', '"startDate":'); System.debug('String Replaced : '+jsonReplacedString); ...
0
votes
1answer
33 views

How to deserialize JSON?

I have an issue which I've been struggling with today. The JSON is returned back to me with a project Id as the key, this Project Id is dynamically generated and due to this I have not been able to ...
0
votes
2answers
27 views

Parse JSON using APEX provided JSON Methods

Salesforce rockstars! I'm in need of some help, and thank you in advance for taking the time to review my question! I'm pretty new to Java/Apex, and most of the work I do is with internal Salesforce ...
2
votes
1answer
31 views

Unable to fetch complete records from bulk query batch result

I am using simple-salesforce python library using REST to call bulk services which is working fine till calling but for large dataset library continuously poll the batch status and spit all result (in ...
0
votes
1answer
37 views

Salesforce JSON not passing as UTF8 to external REST API

I'm trying to send a JSON to an external API in UTF-8 but the vendor tells me it's coming through as garbage. I've set the following headers: for(JSONObj.workflowRequestTableFields wfField: wr....
0
votes
1answer
25 views

How to Deserialize the Trigger old & newMaps in JSON

I'm trying to pass the old & newmaps as arguments to a future method using JSON method. I see the below error when it tries to deserialize the data. reference-Passing SObjects to Future |...
0
votes
1answer
47 views

Einstein Analytics data binding to boolean value

I am trying to conditionally hide tabs based on the output of a certain table. Currently I am attempting to set the navigationHidden property of the page to false like so: "navigationHidden": "{{cell(...
0
votes
1answer
55 views

JSON Formatting in Apex [closed]

To summarize very quickly I am building a REST Integration between two Salesforce environments, where I am querying data from the Source and sending them via Callout to my Target, which has a ...
-3
votes
1answer
35 views

Crete a method to replace salesforce keywords in json

I am creating a generic method which accepts json string as input parameter and replaces keywords of salesforce present in json. After replacing all the keywords I am returning the modified json ...