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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
22 views

In LWC JSON.parse(JSON.stringify(array)) not working as expected

I have an LWC that calls the backend, which makes a callout and returns the response wrapped inside an inner wrapper class with @AuraEnabled member variables and this wrapped class's @AuraEnabled ...
user avatar
  • 456
0 votes
0 answers
35 views

Parse blob in apex

We have a @RestResource apex class using which we are receiving the JSON data from application which resides outside of salesforce through REST API. We parse this data to get the jobId from it and ...
user avatar
2 votes
1 answer
77 views

A Variable Passed from my LWC to Apex Becomes Null

ISSUE The parameter name of my Apex method did not match the name of the variable when I called the method from JavaScript. ORIGINAL QUESTION I've never touched frontend before - I have no clue ...
user avatar
0 votes
1 answer
29 views

How to parse json response from API in apex? [duplicate]

I am calling an API from the apex, giving me the following response. { "status": { "error": "no", "message": "Successfully updated ...
user avatar
0 votes
0 answers
28 views

Accessing HTML content from the email using REST API endpoint

Using the REST API I am trying to extract the HTML content of an email. Endpoint URL : https://SUBDOMAIN.rest.marketingcloudapis.com/asset/v1/content/assets/{{asset_id}} The above URL returns a ...
user avatar
  • 1
0 votes
0 answers
17 views

how to Deserialize the Json with multiple nodes [duplicate]

I want to get the data for Technoloies node(i.e name) form the below JSON. { "Results": [ { "Result": { "IsDB": "True", ...
user avatar
1 vote
0 answers
30 views

How to render JSON array from LWC as a table in Visualforce

I have a LWC with a datatable. I need to generate a PDF of this datatable. How can I pass the JSON string which populates the datatable to a VF page and render the table there? See what I have so far ...
user avatar
  • 398
0 votes
1 answer
37 views

How to deserialize this to get only the value 3.2

I have the Wrapper class, and the testwrapper class, but in my callout class i cant get it to only get out the value: 3.2 this the is api url: https://data.ssb.no/api/v0/no/table/11117 This is the ...
user avatar
1 vote
2 answers
45 views

I have one class and one json method which returns the json string to json object. but while executing it gives null value in debug log

public class fromJSON{ public cls_Student[] Student; class cls_Student { public String Name; //Vinayak public String branch; //Mech public String phone; //909090 } ...
user avatar
-1 votes
0 answers
40 views

Get value from JSON deserializeUntyped List [duplicate]

Im receiving this JSON: {"key":1,"nombre":"Test 2","tipo":"Muestra","cantidad":"11","id":"l780000"} i convert ...
user avatar
0 votes
0 answers
35 views

Trying to Create a Feed Using an External Callout Using Chatter API

What works: All three files are communicating with each other The lightning button calls handleClick() handleClick() gets the return value of getFeedElements() getFeedElements(any given record ID) ...
user avatar
0 votes
1 answer
26 views

Parsing JSON response to an object or a Map

I am completing a challenge for Apex on trailhead. My code is making a callout and receiving certain records in JSON format. I am not able to covert the response into a MAP to process it easily. The ...
user avatar
  • 35
0 votes
2 answers
43 views

why my JSON deserializeUntyped giving me Exception

I'm creating a new REST API in salesforce and receiving the below JSON in Restrequest string {"event_source":"","event_time":"2022-05-25 08:12:40.151","...
user avatar
0 votes
1 answer
25 views

How to convert JSON String of RESTRequest to Map

I'm new to Integration in salesforce. I'm using RestRequest and getting requestBody something like below: {"event_source":"","media_source":"restricted"} I ...
user avatar
0 votes
1 answer
40 views

Compare two maps and update child records

I am working on a web service callout in Apex which returns some child data for the Asset object. I can represent a class to depict the structure of the data that I am receiving. [{ "Id":...
user avatar
0 votes
1 answer
34 views

How to access an Apex Map in LWC JS

In Apex I have a map of Map<Address__c, List<Mortgage_Account__c>>(); and I am parsing this and getting it in an LWC, mortgageSummary. Here is mortgageSummary.js: import { LightningElement,...
user avatar
  • 398
-1 votes
1 answer
39 views

Count number of values under specific JSON key [closed]

I have one JSON output which is parsed from String using JSONParser. Is there a way to check if key "dates" exists and number of values under "dates" in Apex? dates": [ { ...
user avatar
1 vote
3 answers
64 views

Get values from nested JSON dictionaries in Apex

I'm trying to make use of the Jira Rest API from within Salesforce. I am somewhat useless with Java, so hopefully someone can point me in the right direction. I can use the following Apex to get an ...
user avatar
  • 43
0 votes
1 answer
70 views

Apex - Insert json value into custom field

I am inserting records into custom object Rating__c via trigger. This object has a field that stores json value against each record based on Account ID(Related Account). Example: {"attributes&...
user avatar
  • 1
0 votes
0 answers
31 views

JSON for a nested array [duplicate]

Hi I have written a JSON for a nested array for a 2 custom objects in salesforce. But when I compile I received this error; Error: Invalid Data. Review all error messages below to correct your data. ...
user avatar
  • 247
0 votes
1 answer
40 views

Deserialize json into Apex map [duplicate]

I am hitting an external API with request body as below { "recordId1":{ "manufacturer": "ABC", "modelNo": "1234", "...
user avatar
-1 votes
2 answers
67 views

JSON Array String into List

Sorry for this noob question but I just want to ask: String stringJSON = '[{"action":"ASSIGN","value":"Router"},{"action":"DISABLE","...
user avatar
0 votes
0 answers
33 views

Using JS Script that requires JSON-LD structured data in LWC

Hello and thank you for your time, I am trying to use this button which requires a JS script that takes JSON-LD structured data from html, I can't figure out how am I supposed to load it because I can'...
user avatar
0 votes
2 answers
69 views

HTTP GET request desterilize with wrapper class 'non static method' error

Hi all i'm trying to retrive data from a source which gives me a json with all of a certain property listing details such as bedrooms bathrooms etc... so I'm trying to parse the data using a wrapper ...
user avatar
1 vote
0 answers
24 views

REST resource Unicode characters not working (form data)

I'm currently developing a Rest Resource that will be able to handle post method into Salesforce. The request that I get is in form-data(!!!). It contains Hebrew characters translated into Unicode (i....
user avatar
  • 100
0 votes
1 answer
61 views

Handle with different type of params RestContext deserialize

We have a REST service that gets data from external service to salesforce. The data can be achieved using RestContext.request.requestBody.toString(); So I create an inner class to deserialize the ...
user avatar
  • 959
1 vote
0 answers
38 views

JSON deserialization of datetime - accepted format

I have an Apex REST API endpoint prepared that accepts DTO object. One of the fields in this object is of Datetime type. I was surprised that JSON.deserializeStrict accepts datetime to be of following ...
user avatar
  • 1,221
0 votes
1 answer
153 views

Dynamically nesting objects in JSON

I have a use case where I need to dynamically create a JSON. Below is an idea of what a finished JSON will look like: var treeData = [{ Name: "Johnson Holding Company", Id: '1', children: [ ...
user avatar
  • 41
0 votes
0 answers
45 views

Display standard dashboard in different Org

I want to display dashboards used inside several other salesforce orgs (org2,3,4,...) and display them on another org (org1). I have tried several approaches involving Visualforce pages and iframes, ...
user avatar
  • 63
0 votes
1 answer
47 views

JSON exclude may when field is Null

In my code below how can I have it exclude one of the field maps if the value in the correspondence field is Null. So in this example if Field 3 is Null I do not want this included in the output ...
user avatar
0 votes
0 answers
58 views

Parse Json, retrieve and add to DE

I want to retrieve the subscribers from my list and then add to my DE, but the code it's not retrieving the subscribers and I believe that there is a error in Parse Json DE Columns - email (primary ...
user avatar
3 votes
1 answer
345 views

Inexplicable setter behavior during JSON deserialize

I'm trying to deserialize an API response into Apex classes using JSON.deserialize. Everything works fine, until I try to customize a setter on a list property. I've distilled this down to an ...
user avatar
0 votes
1 answer
55 views

How to get the number of objects I received in JSON response?

How can I count the number of objects I received in JSON response? In the below response I got two objects (id:1234, id:2345) and I want a variable that shows the total number of objects received in ...
user avatar
  • 49
0 votes
1 answer
374 views

How to Fetch JSON value from a Salesforce field and display the data in a table in LWC

I am new to LWC and i have a Opportunity record which has a field, Vendor Field, having value as: "Details": [ { "Vendor_Name": "Vendor", "URL&...
user avatar
3 votes
1 answer
411 views

structuredClone is not a function - LWC

Currently working with arrays of objects of arrays of objects and filtering those lists to generate new lists, but do not want to mutate the original list. To do this, I clone the data, and in plain ...
user avatar
  • 1,838
0 votes
1 answer
100 views

Not able to get specified value from JSON

I am having JSON structure like this "line_items":[ { "id":385, "name":"AD737", "product_id":743, ...
user avatar
  • 59
1 vote
1 answer
66 views

JSON dot notation in LWC/Javascript

I've tried searching for a solution, and I think my syntax is correct here, but I can't achieve the desired result. I'm querying an API and getting a returned JSON that looks like this: { "...
user avatar
0 votes
1 answer
123 views

LWC - Checkbox json data response help

So, these are the checkbox that I'm testing. What I have - A function that are associated with uncheck/readonly, and some of my json catch response try. What I need to do - I need to catch the json ...
user avatar
  • 99
0 votes
2 answers
49 views

Array to String conversion

Can I convert an array to a string in apex? Is string valueOf() method an efficient way to convert it?
user avatar
  • 53
0 votes
3 answers
38 views

Problem with Webservice returning invalid JSON

could you please point out my error? I have a very simple class and a webservice: public class JSONFactory { public Integer id; public String name; public String lastName; public JSONFactory(Integer a,...
user avatar
1 vote
2 answers
103 views

How to serialize an object and string variable?

objectApiName = 'Account' newFieldConfigJson={"Type":"Text","Value":"Name","Order":"8"} I have these two values that I need to ...
user avatar
  • 53
1 vote
1 answer
49 views

JSON payload of REST method serialized twice

I have a very simple class and Web Service. The resulting JSON shows that the payload is getting serialized twice. Could you please point out my error? public class JSONFactory { public Integer ...
user avatar
1 vote
1 answer
353 views

How to deserialize JSON array into list of objects

I'm getting a JSON array from a REST callout: [{\"name\":\"Jan0\",\"lastName\":\"Test0\",\"id\":0}, {\"name\":\"Jan1\",\"...
user avatar
0 votes
1 answer
38 views

How can I generate arrays [...] to serialize an object? I want to make a simple JSON serialized

"Hello everyone". I have a couple of days with these json's. I have a json String done, like this: String payload = JSON.serialize( new Map<String, Object> { 'jsonrpc' =...
user avatar
0 votes
1 answer
92 views

How do I convert a ContentVersion record to JSON to pass via API?

I need to share files attached to an account externally via API to another Salesforce org (to recreate the files there). In order to do this I'm trying to create a JSON file to contain the file/s ...
user avatar
  • 1,377
1 vote
1 answer
103 views

Remove quotes from within JSON Values

I am using an Apex Action from SF Unofficial to Pos to Slack from a Flow. One of the parameters in Apex Action is the "block" which builds the body json string for the Slack Post. In the ...
user avatar
1 vote
1 answer
39 views

having issue in Deserialize data in future callout methods and after again serialize that data

I am having issue in serializing the data. { "currency": "", "fields": [ { "key": "Number", "value": ...
user avatar
  • 13
0 votes
1 answer
84 views

HttpPost unable to parse LIST of JSON data

I'm testing this with the Salesforce workbench and I'm using /services/apexrest/myRestRequest/doPost with JSON data { "contacts": [ { "personEmail": "...
user avatar
4 votes
1 answer
222 views

How to best handle "polymorphic" JSON response

I'm working with a 3rd party REST API which has a number of data types (e.g., PlatformAccount, Subscription, etc.). that may be returned from various endpoints, but all responses are of the form: { ...
user avatar
0 votes
1 answer
199 views

JSON Deserialize a string representing a list of Custom Objects

I'm facing a problem from passing a list of custom objects from the Controller of my Aura Componentk, to Apex. Apex does not receive the parameters, It seems to be "normal", I read it's ...
user avatar

1
2 3 4 5
27