Stack Exchange Network

Stack Exchange network consists of 174 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
0answers
10 views

Apex Multipart HttpRequest - With JSON and BLOB

I am trying to consume a Google Drive API to create a file in an ApexController. I was successful in creating a file in the root folder without specifying a name using the code below http h = new ...
1
vote
1answer
26 views

Invalid character in identifier in Wrapper class

I am doing a rest call with the below endpoint string endPoint = 'https://test.salesforce.com/services/data/v43.0/query?q=SELECT+Name+,+RecordTypeId+,+Code__c+from+Account'; I have the below class ...
2
votes
1answer
33 views

Using GTL to Display Data from Nested JSON Arrays

I am building an email using data passed through JSON. Here is an example of the JSON file: { "order": { "items": [ { *Other Data*, "tracking": [ { **"...
1
vote
1answer
27 views

Lightning components - Initiating App attribute with controller - Issues with format and transmission

I'm Working on Lightning components I would like to add some values in my App, using its controller (aura:handler) But it doesn't work at all, so the default values of my component is displayed at ...
0
votes
1answer
38 views

JSON -> Apex Custom Class conversion issue

Im attempting to deserialize a JSON string into a custom apex class but Im getting a NULL value back from one particular node "transaction". Any ideas why its not translating from "transaction" to "...
7
votes
1answer
335 views

Deserialize hits memory limit

We have a custom apex webservice in which we do certain operations and later call a managed package apex method that returns a JSON string which we deserialize and send back to the client. For example ...
1
vote
1answer
44 views

Json attribute not showing in Marketing Cloud

I have a Json string and something does not make any sense to me. Here is the problem: I have a Json string with the following attributes in it: [{"MiddleName":"der","LastName":"Emmerzaal"},{"...
0
votes
0answers
34 views

JSON Parser in Apex [duplicate]

The image shows my JSON Parser Value. I've attached my apex code below. While I run that code I'm getting the value which I've lined it in black color. But I need to get the value which I've lined in ...
0
votes
3answers
33 views

JSON.deserializeUntyped to Map<string,Map<string,decimal>>

I am trying to deserialize json to Map< string,Map< string,decimal>>. json { "redrose": { "11-Jan-2019": "$1.85", "16-Jan-2019": "$1.85", "17-Jan-2019": "$1.85", "18-Jan-2019": ...
0
votes
1answer
24 views

Extract values of the object received in the apex method!

I am passing in an object with mutiple rows of data, which eventually will be saved to the custom object. How do I extract the values of the object that I received in Aura enabled apex method. ...
1
vote
1answer
33 views

Deserializing/Parsing the JSON response to an Apex class

am trying to parse the below JSON request to Apex class. The challenge here is that one of the node "match" in the JSON is suppose to be an array but the external system sends it as a String. I would ...
0
votes
1answer
18 views

Error in Json for Rest Api

I have a trigger that sends a certain opportunity to an unspecified stage, so I have a json with the objects, but I intend to send everything in a single string, so I joined json, when I run the code ...
0
votes
1answer
28 views

How to serialize REST Request from Wrapper class for existing Salesforce data?

I am trying to format my SObject data within a wrapper class to POST data to another Salesforce org from a custom Work__c object, but I am having a hard time understanding how to add an instance of "...
1
vote
0answers
39 views

Parse a String as an Array using System.JSONParser [duplicate]

AN external system for some reason sends a node in a JSON as a String instead of an array like below: "vr_sch": "[{"type":"Record","tableName":"hpd","SId":"868","frequency":"ONCE"}]" The Apex class ...
0
votes
0answers
30 views

How to parse JSON String through apex [duplicate]

I want to get 'guid' and 'attachednotes'The attachedNodes is in different format. I think it is string array, but I am getting an error. { "messageHeader": { "triggeredBy": "manual", "...
0
votes
1answer
43 views

How to create JSON string for REST callout from Wrapper class

I have found a lot of different examples of this, but I'm still having troubles accomplishing this. Here is the webservice which is working: //WORKING Webservice in target org @RestResource(...
0
votes
0answers
32 views

GTL counting Json string

I have set up a GTL and AMP script that looks at my attributes where i passed in a Json string (array). This is the string: `[{"MiddleName":"der","LastName":"Test"},{"MiddleName":"van der","LastName"...
0
votes
1answer
36 views

Fields.Retrieve() doesn't display anything

I would like to retrieve the header of a data extension using SSJS within my Landing Page. Below is my code : <script language="javascript" runat="server"> Platform.Load("Core", "1"); ...
0
votes
1answer
121 views

SOQL: Retrieve records based on List of Booleans

I have this json object coming in for boxes: Boxes: [ { count: 5, Fragile: true }, { count: 10, Fragile: false } ], I have box records that need to be updated based on if they are fragile or not ...
-2
votes
1answer
35 views

how to update fields of campaign using id which i got as method argument with json new value? [closed]

I have the following JSON - {"FieldHistoryTracking":[{"OldValue":"2018-12-28","ObjectName":"Campaign","NewValue":"2018-12-29","FieldName":"startdate","FieldLabel":"Start Date"},{"OldValue":"2018-12-...
0
votes
0answers
11 views

payload issue while run project in mulesoft(anypoint connector)

I am creating contact from anypoint studio(mule soft). I have setup http listner, Transform message,salesforce. when i run this project it's showing some weired error which i am unable to recognized. ...
1
vote
1answer
187 views

JSON.deserialize return null values

I'm trying to Test my Rest Web Service class. I want to simulate the process by taking a JSON and deserialize it to a class - Instead to create all the data by my self. But for some reason - all my ...
0
votes
2answers
37 views

Apex Json parsing [closed]

I need to Show the Image in the Visualforce page based on the JSON property if Media type is equal to image.This is the Json Url:"https://wptestsmc.adflegal.org/wp-json/wp/v2/media?per_page=100 " ...
0
votes
1answer
22 views

alternative way to traverse through json lists of lists of lists in apex

I have the attached json structure and just wondering is there a better way to traverse through the items to obtain them ? whatever i am doing is working and is shown below , but just would like to ...
1
vote
0answers
20 views

InvalidJsonCasing Error while running the command sfdx:package:publish

I have created the package with the command sfdx:package:create -n Consumer -t Unlocked -r force-app and it updated the sfdx-project.json file. Here is my sfdx-project.json file - { "namespace": "...
0
votes
0answers
23 views

Get JSONException with valid JSON. How to figure out what's wrong?

I have a bit of JSON coming from a mock that needs to de deserialized into an object. The JSON itself is perfectly valid. It has been validated by multiple services, and they all say it looks legit. ...
0
votes
1answer
34 views

capturing key and value of json as sobject field value

"element_properties":{ "label":"City", "Required":"TRUE", i have above json(which is not a full one though) where "label" even though is a key , i would need to store it ...
0
votes
0answers
43 views

how to deserializeuntype list<object>?

I have below JSON, that we are getting from external system and I am trying to use json.deserializeUntype to associate it to respective maps, objects etc. And then trying to insert into respective ...
0
votes
2answers
32 views

How to iterate below JSON in salesforce [duplicate]

Need to iterate WorkorderID .......values ....and these are List Objects which has List of Map and values is an array [] "answers": [ { "labelFullPath": { "path": "...
3
votes
2answers
32 views

Convert different Date Formats into Date based on User locale

I am getting different formats of date formats in date field from Json as a string. I should be able to convert any Date format into Date based on user locale.below are the example of formats. Ex: "...
2
votes
2answers
64 views

How to parse this JSON response returned in Einstein Chat-Bot?

Currently getting raw JSON response - { "coord": { "lon": 73.85, "lat": 18.52 }, "weather": [ { "id": 800, "main": "Clear", "description": "clear ...
2
votes
1answer
34 views

Nested Wrapper data not being return in lightning component callback

I currently have this very nested wrapper class, public sharing class ResultWrapper { //This wrapper is contain more wrappers that goes as far as 5 level deep. @AuraEnabled public ...
0
votes
1answer
64 views

How do I search a key or a value in a Nested Json object/array? [closed]

Assuming I have JSON data response as follows below and a Search Input on my lightning component. I want to search for a key or value and get a JS array of results. For example : Searching for "...
2
votes
1answer
30 views

JSON.deserialize on custom sObject not parsing related fields from lookup relationship

I've got a map whose values are a wrapper class. The wrapper class holds a custom sObject list, and the sObject in turn was queried to include related fields from a lookup relationship. Problem is, ...
0
votes
1answer
24 views

Adding Additional Fields to a sObject in Apex, (just for manipulation)

I'm working with some complicated queries, and I need to send over http, the sObject in turn, but I can't make queries with more than 1 level of depth in the SOQL, so I am working with separated ...
1
vote
2answers
41 views

How do I merge multiple Map/JSON Object into One Map

I am trying to build a json out of List of Maps but I need to merge few maps together when matching key is found. How can I merge few Apex Map Object values ? For example: Map<String,Object> ...
7
votes
3answers
181 views

How to create a recursive method in Apex which takes a dot notation string and convert it into Hierarchical Map/Json?

I'm trying to create a utility class/method where a certain method will accept a list of Strings - each string will be constructed as follows: "Root.Parent.Child... N" This string can be N long (or ...
0
votes
1answer
28 views

Salesforce Connect - Associated table in the external data source can't be found

New to Salesforce Connect, but not necessarily new to parsing JSON responses and utilizing webservices. I am attempting a test connection to https://jsonplaceholder.typicode.com/comments with ...
1
vote
2answers
54 views

How do I parse this particular JSON with Json2Apex?

This is the http response body - I want to get to "entries" 'id' and 'name' values, which are inside "item_collection". I'm having a hard time understanding how I proccess this. { "type": "...
0
votes
2answers
105 views

How to remove key-value from JSON if it has empty value?

I have this inner Class which has contactInfo to be sent as JSON now I want to remove the one key value if that has empty value: public class ContactInfo { public String town; public ...
0
votes
1answer
25 views

Malformed JSON: Expected '[': how to deserialize JSON with REST API?

Error: Malformed JSON: Expected '[' at the beginning of List/Set I think I have incorrect JSON.deserialize for my object. How can I fix it? I don't use a wrapper. List<Account> accList = new ...
1
vote
1answer
21 views

HttpGet and Callout: is not a valid Salesforce ID for the type

I get Item's list from 1 organisation and want to insert them like Another Items in 2 organisation. But it try to insert it with Id. How can I fix that? Error: System.DmlException: Insert failed. ...
0
votes
1answer
56 views

Storing JSON reply payload object in Data Extension

I'm successfully getting a result from an HTTP.Post call. My reply comes in a form of a JSON and looks something like this: { "Result": { "Message": "", "MessageDetails": "", "Status": 1 ...
1
vote
2answers
177 views

json.serialized reorders the attributes in a json

I have a json string as name value pair , but when i use json.serialised , it reorders as value and name for every attributes ,Ideally system will find the attribute based on name , I am pushing it as ...
1
vote
1answer
103 views

parse json response into name value pair

I have a json string , and i want it to be converted into name value pair json string. My actual string: {"payload":[{"YearlylCostPercentage":"4.6", "TotalRepayment":"120000","PropertyMarketValue":...
0
votes
1answer
24 views

JSON with backslash for CURL. Not able to generate Apex request class

I have a request JSON that other system has given to use. It looks like below: { \"list\": [ { \"m1\": \"tval\", \"fill\": { \"tool\": \"4535\" }, \"respfield\": ...
0
votes
1answer
34 views

Invalid conversion from runtime type ERROR

I'm trying to parse json response.. but keep getting this error Invalid conversion from runtime type List ANY> to Map String,ANY> Map<String, Object> MapLv3 = new Map<String, Object>()...
0
votes
1answer
16 views

Cant get the 1st row from JSON Parsing array

Im trying to get the participants data from API response.. //Level 1 Map<String, Object> MapLv1 = (Map<String, Object>) JSON.deserializeUntyped(parser); ...
0
votes
2answers
33 views

Using While loop for API callout

Im trying to test if I can request an API without timeout or reach the sfdc api callout limit.. I want to loop the request because the API only show the response for the 1st 25 records of each page ...
-1
votes
2answers
28 views

Formatting Json Response string to date in lightning component

I am working on a requirement for making API call getting the response and showing it on lightning component. My Json responce for one of the field is nextPeriodEndDate=20170406. I need to make it ...