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
25 views

How to check if a http response is null when it is an empty object and status code is 200?

Im making a POST to an endpoint and this is what I get back in my response, its a successful POST and the status is 200 but the payload is empty. { "payload":[], "datetimestamp"...
1 vote
1 answer
24 views

Issues with Json2Apex

I've generated JSON2APEX class for complicated JSON, but when I created an instance of this class I can't deploy class where this instance is created, compilator doesn't see inner classes and throws &...
0 votes
3 answers
40 views

Building an email from JSON Payload that is over 4000 characters (SFMC)

I have been testing using GTL in SFMC to build an email from a JSON payload stored in an email. The reason for this is that there is often multiple products the customer can purchase, and they want to ...
  • 3
0 votes
1 answer
37 views

How to deserialize JSON array which contains custom fields? Passing data from LWC to APEX

I have an array JSON which contains custom fields as well as some other data as below, jsonString = '[{"Id":"a2l0E000000WFL2QAO","Name":"TCIP-0000022","...
0 votes
0 answers
33 views

The value for targetId in Community1/variations/userProfileDataAccessRequestComponent.json isn't valid. Check the value and try again

I have enabled Enable ExperienceBundle Metadata API and tried to retrieve a Experience Bundle community via VS Code but obtained an error. The value for targetId in Community1/variations/...
0 votes
1 answer
48 views

My JSON structure gets extra branch when I try to debug

I requirement is to send data from my salesforce org to SAP org. I have successfully written the APEX Class for it. Problem was the JSON structure (see below) was branched and I did not know how to go ...
-1 votes
0 answers
30 views

Deserializing the JSON response and assign to wrapper class [duplicate]

Team, I have to build a wrapper class to handle the JSON response returned by the API. JSON:- {"@type":"p999:DirectDebitElement","enrolledDate":"NULL","id&...
-1 votes
1 answer
87 views

How to put values (to be JSON serialised) in an inner class which has an array

My requirement is to send data from my salesforce org to an ext org (SAP S4). I have successfully integrated the same by creating an http apex class which sends data from my org to SAP on executing ...
-1 votes
1 answer
204 views

How can I count the number of objects in my JSON

In the Marketing Cloud I have an attribute field. In this field a JSON is stored. Like so: [{ "Example1": "XXXXX", "Example2": "XXXXXX", "...
  • 117
1 vote
1 answer
63 views

Parse a nested JSON in a list/array to display it in a table in LWC

Below is my JSON and I want it to parse and display the contents in a table in LWC like below. I used the JSONtoApex tool to create the parser class but I am not getting in which format I should ...
  • 25
-1 votes
1 answer
50 views

How do I set a dynamic body JSON format which should contain object data (like values of fields in Contact object)

My requirement is to send data from my salesforce org to an ext org (SAP S4). I have successfully integrated the same by creating an http apex class which sends data from my org to SAP on executing ...
0 votes
1 answer
60 views

Deserialize Very Specific JSON into Map <String, Object>

I have searched internet for hours and can't find how to convert my specific JSON: [{"_id":"55d66226726b611100aaf741","replacement":false,"quantity":5,"...
-1 votes
1 answer
39 views

Convert List of Objects to List of sObject in apex

I am trying to convert list of Object into list of sObjects, basically I was getting a CPU Time Limit error in apex so for avoiding that I tried to process data into javascript file (AURA) and now I ...
-1 votes
1 answer
55 views

Casting from a JSON body to a List of a specific Object

I am trying to convert JSON, which is something like this: [{"_id":"55d66226726b611100aaf741","replacement":false,"quantity":5,"name":"Generator ...
-3 votes
1 answer
39 views

JSON Conversion [closed]

I want to convert a JSON to a particular format in apex JSON { "customers" : [ { "Sales_Force_Customer_ID" : "0012500001xxydWAAQ", "FirstName" : "...
0 votes
1 answer
28 views

Apex replace \" in string

String jsonString = 'Error \"fatal\"'; String jsonString2 = jsonString.replaceAll('\\"', ''); System.assertEquals(jsonString, 'Error fatal', 'Assertion failed'); The jsonString ...
  • 302
-1 votes
1 answer
103 views

Replace String inside json inside Array Javascript

Hello guys I have a js file that has a list of json that have the next structure: [{"label":"9312 - Item1", "value":"9312"}, {"label":"9313 -...
  • 77
1 vote
0 answers
49 views

Unable to access array within an array from Salesforce flow http callout (beta)

In sandbox, I am attempting to gather the information from https://data.nasdaq.com/api/v3/datasets/USTREASURY/YIELD.json I used the beta feature of creating an HTTP callout right from the flow. It ...
  • 73
0 votes
0 answers
18 views

Apex parsing properties with dots in JSON keys [duplicate]

An external endpoint sends this JSON response: { "domains": { "example.com": "ABC", "domain.xyz": "DEF" } } parsing into an Apex class ...
  • 302
0 votes
2 answers
126 views

JSON Parsing in marketing cloud email AMPScript

I have a JSON string which contains a 'body' key as a string, which is an escaped JSON that has keys and arrays. I want to read the JSON and extract the 'body' key and then extract the arrays inside ...
  • 3
2 votes
2 answers
178 views

Working with Map<String,Object> and Parent Records

Good morning/afternoon/evening, I'm working with some code I got from GitHub to generate a CSV from a List<Sobject> someQuery However, it doesn't do well with parent records (i.e. Donor__r....
  • 1,380
0 votes
2 answers
41 views

Replace '{}' in Apex

Hello everybody I am passing a Json from javascript to an Apex controller to validate some info. The problem is that the json comes with some values like this: "Direction": {} And I want to ...
  • 77
0 votes
0 answers
40 views

Add node when data Javascript LWC

Hello everybody I am working with a LWC form. In my .js I create a json wrapper to pass the user inputed information to an Apex controller to validate each one of the data. Such as this: cliente:{ ...
  • 77
0 votes
2 answers
30 views

Batch avoid inserting duplicate records

In a batch that deserializes a large json in the start method, iterates over its rows and creates new records in execute. How to check if there are already records with that external id (field on the ...
1 vote
2 answers
68 views

Simple select from JSON

I'm sure this is a dumb question, I just can't get it to work and I can't figure out why. I have this JSON: [{"prop1":"250","prop2":"1"},{"prop1":&...
0 votes
1 answer
50 views

Building dynamic subjectlines with JSON

I have an email that can have multiple subject lines. This is based on the incoming data. For this, 1 content block is loaded containing all the different subject lines. The correct subject line is ...
  • 117
0 votes
1 answer
84 views

How to add CSS in HTML if I have 2 Titles on LWC

I created 1 LWC, in which I have main Title & I wanted to add another Title in the same HTML page. <template> <lightning-card variant="Narrow" icon-name="standard:...
  • 5
0 votes
1 answer
145 views

Unexpected end of JSON input when trying to authorize my sandbox from vscode

I am trying to authorize my sandbox org from vs code > After logging in with my credentials, I keep on seeing this output from the browser which I Quoted below "Unexpected end of JSON input ...
0 votes
1 answer
67 views

Developer Edition - Salesforce Keeps Navigating To Salesforce Classic

I don't know why my Salesforce Developer Edition keeps directing to Salesforce Classic and getting those errors: DevTools failed to load source map: Could not parse content for https://xxx.my....
  • 33
-1 votes
1 answer
74 views

Parse cloud page data into Data extension

I have data on cloud page in this format. It is neither a JSON nor XML that i can easily parse. I basically retrieved this with a HTTP GET and write it on cloud page. My goal is to load this data into ...
1 vote
1 answer
320 views

Why is `JSON.parse` returning a proxy object?

Because Lightning Web Components so often wrap objects in proxy objects, we long ago created a deProxyObj in order to be able to log to the console while debugging. const deProxyObj = (proxyObj) => ...
  • 805
0 votes
1 answer
47 views

Nested Json not detected

I'm trying to parse a nested JSON through a REST Api but somehow it is not getting read. For example: I'm passing a JSON like this in my request body. [ { "first":"I like sfdc", &...
0 votes
0 answers
55 views

Show list of error in ShowToastEvent LWC

Hello everybody I am currently working with a LWC form that gathers information from the user and send it to an apex class that verifies if the data from the user is correct. In case of not being ...
user avatar
1 vote
2 answers
68 views

Part of the name of a JSON structure should be dynamic (Apex)

I have a method that receives a large and complicated JSON. The definitions of some of it's parts are: public class LanguageSpecifics { public String description; } public class I18N { public ...
1 vote
1 answer
164 views

Issue with formatting JSON for Rest API Post Request

First-time poster here so feel free to give me pointers on forum etiquette. I have been trying to teach myself Apex the past 2 months and I have a personal project that I am working on that involves ...
0 votes
1 answer
69 views

How can I retrieve particular data from json string using Apex? [closed]

When individuals fill out a survey through an outside source, the JSON data gets stored in Salesforce as a Long Text Area in a custom Survey__c object (about 25,000 characters). There are hundreds of ...
0 votes
0 answers
28 views

Not able to update field value on a record. Getting System.LimitException: Too many DML statements [duplicate]

I want to update a field value through apex but getting error System.LimitException: Too many DML statements Please find the code: @AuraEnabled(cacheable=true) public static AuraMethodResponse ...
  • 73
2 votes
1 answer
87 views

How to deserialize a list<Object> without using indexes

I have this JSON: { "Details":{ "Customer Input": "Type Here", "Input Status": 0, "CumulativeValues":[ { ...
0 votes
2 answers
60 views

JSON Exception "Illegal value for primitive" obtained during response parsing

I am calling a Webservice which returns the following as JSON response. **REST Response** : {"totalRowCount":1, "hasMorePages":false, "data":[ { &...
  • 3,053
2 votes
1 answer
110 views

How can I display data that is [int, str], [str, str] type from JSON to LWC DataTable

I'm trying to display data from HTTP API response from third system in LWC app. The problem is, that some of that data that I get from the external system is in following types: I have trouble ...
0 votes
2 answers
243 views

Send wrapper from LWC to APEX

Hi everybody I am trying to send a wrapper from LWC to an apex class. For that I have the function handleValidation which is triggered when the user clicks the button validate: wrapperToApexClass; ...
user avatar
-2 votes
1 answer
36 views

fill json with data

Hi everybody I am trying to do a LWC form where the user inputs some values and with them populates a json. So for example I have the lightning-input: <lightning-input type="text" label=&...
user avatar
2 votes
1 answer
182 views

LWC - trying to create a combobox from JSON response

(Updated code) - thanks, @sfdcfox I have been stuck on this for many hours now, I really hope someone can share an insight: I have a combobox, and I wish to populate it with the values at this API ...
  • 21
2 votes
2 answers
2k views

System.JSONException: Illegal value for primitive

I am trying to parse a Json response into a custom class. The Json string looks something like this. In short it is a json with some key which is also an array of json objects. String JSONContent = ...
0 votes
1 answer
69 views

wrapper class does not match with json resulted from POST request

I have this apex class (coded by another developer) @RestResource(urlMapping = '/thunder/contapj/*') global class Thunder_SVC_ContaPJ { public static Log_de_Integracao__c log = new ...
0 votes
0 answers
96 views

JSON Exception for Restful Apex Service in test class

Creating a Salesforce REST Api to create a contact when json is posted to it from workbench and my code functions correctly but my test class gives me a weird error that I am not sure how to fix. The ...
0 votes
1 answer
176 views

How to retrieve JSON values from a Data Extension

I have a basic javascript for retrieving values. Like this: <script runat="server"> Platform.Load("core", "1.1"); var list = ["value1",&...
  • 117
0 votes
2 answers
135 views

Is there a way to parse JSON without names?

we have a simple JSON structure. This structure has no names like this: ["value1","value2"] Is there a way to parse/use this in Marketing Cloud? We don't have to make decisions. ...
  • 117
2 votes
1 answer
175 views

LWC: Lightning datatable not displaying the data stored in localstorage

My requirement is to pass selected accounts on Opportunity Record page to Opportunity Product Record Page. I have two LWC created for each page. From Opportunity Record page I'm storing the selected ...
  • 73
0 votes
0 answers
102 views

lightning tree grid not removing data on filter change

I have a lightning-tree-grid with a filter. When I initially select a value in the filter, it works fine. However, when I change the filter to a new value, the previously pulled records remain in the ...

1
2 3 4 5
29