Questions tagged [parser]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
28 views

Parsing JSON Response Issue with escape characters [duplicate]

Below is the response from an external system. In Salesforce, I need to save the value of test1. Now JSON Parser it trying to destruct the test1 value also because it has escape character before the ...
0
votes
0answers
15 views

Apex parsor class test coverge. I did all thing correct but coverage for parsor is not proper [duplicate]

I have a apex class for making call out and response is Parser using a Parser class. Now i wrote a test class but the Parser class is not getting covered properly. Do any one have any idea how to get ...
0
votes
0answers
48 views

Transforming a read-only map<String,Object> criteria of a RemoteObjectController.retrieve into workable Apex SOQL?

How can a visualforce page (or the page's controller) access the NON-paginated results size of a Remote Object Model's RemoteController.retrieve query? Here is the relevant part of my override method,...
0
votes
1answer
121 views

External Service - Parsing XML/JSON

I am trying to implement an integration with a third-party system to Insert Products into Salesforce. I have created the External Service, consumed the schema, and was also able to make a call to the ...
0
votes
1answer
128 views

How to parse this json into apex list of strings containing SpecialName values?

Hey fellow salesforcers, Im a bit stuck parsing specific values from a json into an apex List stringList Using apex (with or without using Json2Apex), how can we parse the following JSON structure to ...
-2
votes
1answer
146 views

Apex Job Error: can't parse argument number: org

can someone please help me with this issue can't parse argument number: org: This is the Batchable class: global with sharing class IMB_SendPushNotificationsBatchable implements Database.Batchable<...
3
votes
1answer
303 views

SOQL Parser implementation in Apex

In my app, I get passed in user-generated SOQL query strings and need to validate and modify them. For that, I would need a parser that can extract me chunks They contain many SOQL features like: ...
1
vote
2answers
458 views

Handle unknown properties with typed JSON.deserialize()

I am looking for an elegant and unhacky way to handle deserialization of a JSON into an Apex type where some of the properties are known and some are not. Assumption: At least for now the unknown ...
2
votes
1answer
991 views

How to parse large size csv file content into custom object in Salesforce?

I have requirements to implement the LWC file upload wizard which should handle very large size csv file( about 1 GB).. is it doable to parse such large size csv through APEX batch method? I tried ...
-1
votes
1answer
76 views

CSV parser to insert records into Custom Object

I have a requirement to insert records into custom object called Custom_Business__c using a csv file which is stored as a static resource. Below is the code I've achieved so far public class ...
2
votes
2answers
161 views

Deduce Schema.DisplayType from a sample of JSON property values

From a REST API my Apex is receiving a list of JSON objects with previously unknown properties. To store those properties I want to dynamically enhance a Custom Object by adding suitable Custom Fields ...
0
votes
2answers
40 views

How to get value of a record after parsing [closed]

I have parsed an object and want to get a value. How do I achieve this. Its a little confusing for me, is this a list I have to loop trough or an object. My debug shows the following: oldList: ...
0
votes
2answers
45 views

Reading a JSON structure in Javascript

I am trying to read this json string in Javascript so that I can access its node. However I get undefined. const jsonStr = '{"data":"{\"page\":\"1\",\"firstName\":\"c\",\"company\":\"\",\"...
2
votes
1answer
557 views

Blob is not a Valid UTF-8 String - Only after "–" [duplicate]

I created a CSV parser that parses CSV's from static resources. I am returned with a Blob is not a Valid UTF-8 String error when parsing the character: "–" different from "-". The "–" is apparently ...
0
votes
1answer
40 views

Access location in JSON2APEX class from Mapquest JSON

I converted Mapquest geocoded data into an Apex Wrapper using JSON2APEX. Now I need to access the location information longitude and latitude: Mapquest JSON: { "info": { "statuscode": 0, "...
1
vote
0answers
49 views

JSON Parsing Question

I'd like to ask everyone their input on the preferred way to parse a JSON response where the structure varies. I created a class using the json2apex service and it looks very solid. However I have ...
0
votes
1answer
372 views

ParseJSON Error for HTTPPost - SSJS Unable to retrieve security descriptor

In my marketing cloud, landing page. Getting the error "System.InvalidOperationException: Unable to retrieve security descriptor for this frame" while trying to Parse the JSON response in a HTTP Post ...
0
votes
1answer
21 views

deserialize a JSON and modify a single attribute in the list of Object

I have a JSON string as below from a http response. { "agreements": [ { "agreementId": "ag0", "publishedDate": "04-03-2016 00:00:00", "AgreementNumber":...
0
votes
1answer
4k views

Parse child JSON object in JSON array

i am trying to parse a response which is a json object that has JSON array, what I need is to get value in the specific object from the array, inside "results" I'd like to get value from key "id" ...
1
vote
0answers
153 views

How can I parse an "@odata.nextLink" to an apex class?

My json response from Azure includes an attribute that's "@odata.nextlink: [url]". In my parser class how can I get this url value? I can't declare it as something like Public String @odata.nextLink ...
1
vote
2answers
68 views

Correct JSON Parsing without substringBetween

I'm using a bad practice in my code. I get all needed values from JSON like this: Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('Endpoint is here'); ...
0
votes
2answers
110 views

Email To Salesforce. Is there anyway to remove the replies of the email?

I have recently set up some email to salesforce functionality. However email to salesforce also logs all of the replies from the email, so after a few replies, the task contents become rather lengthy/...
1
vote
1answer
267 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": [ { ...
2
votes
1answer
85 views

Can we analyze PMML models in Salesforce?

Is there any piece of Apex code or Managed Package that is able to read and parse PMML models, and then evaluate them on a given set of data? I cannot find anything directly, and hoped some of you ...
1
vote
1answer
503 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"...
2
votes
1answer
433 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
1k views

Invalid character in identifier

I am getting an error on my JSON2Apex class: Error:(7, 18) Invalid character in identifier: Holding_to_Fund__r Error:(44, 19) Invalid character in identifier: Holding_to_Fund__c I need to parse ...
0
votes
0answers
49 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
1answer
594 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
0answers
82 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 ...
1
vote
2answers
404 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, ...
3
votes
1answer
2k views

How to read JSON that contains field that can have different types

I am writing a callout in Apex with returns a JSON file with a field that does not have a consistent type. The JSON returned is quite complicated, so I have been trying to read the JSON with a Apex ...
1
vote
1answer
77 views

How to convert Json string with adminbooster and call a value

I am newbie trying to find a wordflow which makes it easy to convert JSON strings to apex I used adminbooster but get for example public cls_0 0; public class cls_0 { public cls_0 0; throws an ...
5
votes
3answers
2k views

JSON Parser getCurrentToken()

I have a JSON string that I want to parse out. I have use the below code many times but for whatever reason this time it is not working. Can anyone poke any holes in this logic? Or point out why this ...
6
votes
1answer
3k views

What is recommended way to unit test JSON Parser based on JSON.deserializeUntyped calls?

We are doing a lot of JSON data parsing in our solution by own JSON parser implementation. I wonder how can I write unit tests for JSON parser. Is it good approach to load JSON data from static ...
1
vote
1answer
471 views

Convert Json to apex by adminbooster class and testclass

How do I use the json2apex tool. I generated an apex code and I am trying to split this in an apex class and testclass but get the error: Method does not exist or incorrect signature: void parse(...
3
votes
1answer
675 views

Callout exception Illegal value for primitive

I can't work out why I'm getting this error. Ultimately, I'm just trying to send a list of SingleEmailMessage via callout, but that's not a valid type for the post method nor can it be directly ...
0
votes
1answer
27 views

Substring based on a word and immediate next third bracket

I have a large text value as below in a custom field of a custom object. FINDDATA: [XY_8852376....... {name:"State__SKN", "data": "State__SKN", defaultContent: '', className:"frozencolumnscolor", ...
-2
votes
2answers
7k views

Apex - How to parse json response to a map

I am getting a json response from an API call. System.debug('result is : ' + responseToken.getBody()) //This response.body format is as below: { "email":"are02@gmail.com", "LastName":"ABCD", "...
0
votes
0answers
122 views

Apex SOQL/SOSL Parser

Is there an Apex-based DML, SOQL and SOSL parser? I see the only way this could happen is during the time of deployment, I can use DeployDetails to get the list of SOQLs. Any pointers on how I can ...
1
vote
1answer
1k views

How to generate generic Apex Code from WSDL?

Is there any process where we can generate apex code whenever the WSDL changes such that changes in the WSDL can be added/updated to the Apex class/classes in a generic way such that we do not have to ...
3
votes
1answer
99 views

Compile Asset Model

I'm trying to compile the asset model using the reference from this page : https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/compiling-asset-model.htm I'm trying to ...
1
vote
2answers
3k views

Convert JSON String to a list<Class>

How do i parse a JSON String to a list. Here, I have a class named LatestStatus and it has its variables. I need to expose these variable as table in lightning component. JSON String : { "...
0
votes
1answer
2k views

how to parse XML file having nested tags using XmlStreamReader?

my xml string is below - <articles> <article> <source>EN-US</source> <target>SL</target> <id>ka1800000000eCYAAY</id> <publishstatus&...
1
vote
2answers
2k views

Returning a value from JSON Object

Hi I am trying to return a second value pair (string) from a JSON object using APEX's own built-in parser. The API query takes a string variable of a web domain. However, I am getting a strange ...
5
votes
2answers
13k views

Json deserialize with wrapper class

I have created a wrapper class , below is the class public class Wrapperclass { public String pictureUrl {get;set;} public String publicProfileUrl {get;set;} public class basicdetails{ ...
1
vote
3answers
2k views

DateTime conversion to time zone

I want to save event in picked timezone. So the cese is: If user location Moscow, he want to create meeting in London, he checks picklist London. And the event must be saved in London time. For ...
3
votes
1answer
2k views

Unexpected character ('}' during JSON desearilization

I get a JSON response from external system in the resposne.body() The JSON looks like this: "[{\"workOrderNumber\":\"WO-02612\",\"workOrderId\":\"a3F5C000000LHB0UAO\",\"processingStatus\":\"Open\"}]...
0
votes
2answers
5k views

Form JSON structure and add values of all child record of a parent object

I have to populate the values in a JSON structure. The values are obtained from the fields of a parent object and also the child object. I may have more than 1 child records of a parent object. how ...
0
votes
1answer
3k views

Generating a JSON using apex

I looking at the code on how to generate a JSON structure like below: 1. { "element1": "123123", "element2": "test", "element3": [{ "element3.1": " ", ...