Questions tagged [parsing]
The parsing tag has no usage guidance.
47
questions
0
votes
1answer
32 views
Help with storing JSON data
I'm new to salesforce and I have to parse this JSON and store the values in variables. I have used json2apex which generated 2 classes for me. When I use system.debug I can see it's reading the JSON ...
0
votes
0answers
20 views
Json parsing in Apex [duplicate]
I have a sample json like this:
{
"userStory" : {"name":"US41235", "referenceNumber":"xx", "projectName":"yy"},
"...
0
votes
1answer
31 views
CDT time conversion to salesforce dateime field format
I have been stuck in a problem actually i am trying to covert a datetime format in salesforce date time field format
The datetime format which i am getting is 2020-09-13 10:37 CDT
I tried removing CDT ...
0
votes
0answers
36 views
Inserting bulk records from CSV on an object and capturing error rows
I am working on parsing CSV file to insert bulk records on an object (OBJECT 1)and populate two lookup fields(OBJECT 2 & OBJECT 3) on it. If the lookup records are already present in the database ...
1
vote
1answer
157 views
How to respect non-self-closing br tags when apex parsing HTML with “Dom.Document” class
I'm trying to parse an HTML string. This string comes from a Salesforce rich text editor's content. It's a field saved on a record.
String html = '<p>hello<br>goodbye</p>'
String ...
-2
votes
2answers
133 views
Replace `“{”` to `{"` from String in Apex
Please hear me out before marking this as duplicate or irrelevant.
I have done one integration and I am getting data something like this.
{
"page_number": 1,
"page_size": 10,
...
1
vote
1answer
24 views
JSON Objects into string type
I have a doubt regarding the JSON deserialiser method.
So when we deserialise a JSON response or JSON file. Is there a way to make every attribut and value into a string type rather than its original ...
1
vote
2answers
104 views
How to parse inner child aray/object?
please do not close my case. I have submitted the same question couple of times yesterday, but someone has posted a link. Am sorry for that, am very new to this coding. But i managed to print all the ...
0
votes
0answers
514 views
Find/Replace JSON Keys with Apex
I'm stuck preparing a JSON body for a request. I am pretty new to JSON and don’t fully understand the parsing class syntax, but I conceptually understand what I’m trying to do.
Overall Goal: My ...
-1
votes
2answers
41 views
Issue with parsing json
//
// Generated by JSON2Apex http://json2apex.herokuapp.com/
//
public class JSON2Apex {
public class Status {
public String self;
public String description;
public String iconUrl;
...
0
votes
1answer
28 views
JSON Deserialize Error : Expected '[' at the beginning of List/Set
Im trying to deserialize a JSON to object. The JSON response looks like this :
{
"o_gpid": 2000000237,
"o_bilreq": "BR-0000000371",
"o_netrv": "3603000000",
"o_ucogs": "3120900000",
"o_ntgp2": "...
2
votes
1answer
1k views
org.auraframework.util.json.JsonStreamReader$JsonStreamParseException
everyone. I am currently working on a Salesforce practice chunk. I just copy/paste, but at the moment of saving my code, throws me the following error:
( // Load expenses from Salesforce
...
0
votes
0answers
29 views
How to handle both a single item and an array for the same property [duplicate]
I have an incoming JSON payload that with the parameter device_config. This parameter might be, at times, sent as an array of strings or a string. How would I handle this parameter when its being sent
...
0
votes
1answer
254 views
CSV file string parsing by newline error
I'm trying to write unit tests. The unit tests have input of a stringed csv file. So I'm having csvFileDataAsString as the simulated input.
String csvFileDataAsString = 'Column1,Column2,Column3\...
0
votes
1answer
742 views
How to provide default DateTime value in UTC time
I am providing a default value to a DateTime field in my apex class.
customobject.DateTime__c = DateTime.parse('01/01/1990 12:00 AM');
I want to set the default value to 01/01/1990 12:00 am UTC ...
0
votes
3answers
5k 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
1answer
88 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.
...
1
vote
1answer
600 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 ...
1
vote
1answer
1k 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 ...
0
votes
2answers
104 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 ...
0
votes
1answer
739 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
85 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);
...
1
vote
1answer
982 views
Parsing Using JSON2Apex
Im trying to use the JSON2Apex to get the parsing class for my API response.. I only need the metrics data for each userId, but I cant get the variable and the system always giving error Variable ...
1
vote
1answer
1k views
Method does not exist or incorrect signature: void parse(String) from the type or_propertyJSONTest
I am new to apex callouts and trying to do some JSON parsing. I used the online tool https://www.adminbooster.com/tool/json2apex which worked great.
I got a class and a testclass from the ...
0
votes
2answers
225 views
Help Parsing JSON Body
Im trying to get the Id and Name from JSON Body that I requested, and put the value into custom object
{
"id": "ab24ddb8-f1ef-4cca-ae72-9f20f5975332", <-- THIS
"name": "App Dev Account", <-- ...
1
vote
1answer
7k views
Best way of generating a random number
In order to get fake IDs for testing needs I wrote something that works and is reusable, but I'd like to know if there is better ways because my code seems heavy.
n is the total caracters of the ...
0
votes
1answer
3k views
System.JSONException: Unexpected character ('1' (code 49)): was expecting comma to separate OBJECT entries
"sourceMessage": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><error code=\"VALIDATION_FAILED\"> <failure cause=\"INVALID_VALUE\" field=\"Status\" value=\"NotDefined\...
0
votes
1answer
242 views
Is there a limitation of date value while parsing in apex
There seems to be some parsing limitation on string dates in apex.
When I am doing the following it throws a system exception saying invalid date:
String s = '12/31/5000';
Date.parse(s);
However ...
-1
votes
1answer
84 views
How do i deserailize this json string
Can Any one help me in deserializing this json string:
"(ActivityHistory:{AccountId=0011a00000qWdtzAAC, Id=00T1a00001m4m99EAA, WhoId=0031a00000u3iXlAAI, Subject=Call, Status=Completed, Priority=...
0
votes
2answers
2k views
Handle Extra “\r\n” new line in CSV from code level
I'm using the following code to Parse CSV file in Apex:
public static List<List<String>> parseCSV(String contents,Boolean skipHeaders) {
List<List<String>> allFields = new ...
0
votes
3answers
290 views
How to parse a hal+JSON response that has a invalid node name
In general I know how to create a apex class to parse the JSON response in salesforce. But with the current system I am integrating has a weird node name format and i having issues with creating apex ...
0
votes
0answers
55 views
Parsing ERROR Ending position out of bounds: 255
Need some help with parsing csv thru apex . Below are the records i am trying to pass in csv but i am seeing an error : Ending position out of bounds: 255
1,,,"ABC,DEF",,"Robert, Thoma; (CFD)", ,Me ...
1
vote
2answers
299 views
Convert HTTP Response date to Apex Datetime
I have an HttpResponse object with the Date as a header property. Its format looks like this:
Thu, 13 Jul 2017 06:59:43 GMT
and I would like to parse it as an Apex Datetime object.
I did multiple ...
1
vote
0answers
104 views
Taking the email body information from an Email-To-Case
We are currently using Email to Case for one of our customers and they send us in their data straight out of their system i am guessing using a template,
They have the data in the same format and i ...
1
vote
1answer
410 views
Deserialising JSON with a '.' variable
I am attempting to deserialise a JSON response with some variables that Salesforce is having a problem handling because there is a '.' in the object name (as well as a '.' in some variable names).
...
1
vote
0answers
189 views
Parsing Google Sheets JSON response
I am working on a project where I need to access values in a Google Sheet, scan them for certain keywords, and if they meet a particular condition, copy the data from a given row into an object in ...
0
votes
0answers
208 views
Selectively Parsing a JSON file
I am attempting to parse MatterMark's API, but I am planning to do so selectively, picking only the value pairs that are relevant. The example JSON response is available to be viewed in MatterMark's ...
4
votes
1answer
629 views
Pass Case Ids collection to visual workflow from Case List View Custom Button and update cases taking from input screen
Requirement
From Case list View, user will choose one or more cases and will click on "Update Due Date" button, where it will show a screen to choose the "Due Date".
Due Date screen
And finally ...
1
vote
0answers
65 views
Apex Generation Failed (WSDL parsing error) [duplicate]
I'm trying to parse a simple Webservice and I'm receiving this error:
Apex Generation Failed:
Unable to find complexType for {http://soap.***}RelationshipReferenceTo
There are two lines in ...
2
votes
1answer
764 views
WSDL error in parsing process
I have been trying to parse a WDSL file in FuseIt and also in SFDC, but I get an error that it is not allowing me to generate the apex classes I need.
This the error I get in SFDC:
Apex ...
2
votes
2answers
62 views
Strategy On Restructuring SOQL Query
I hope someone can lend some advice on how to go about this issue. I believe it to be more of a strategy question.
After my code as been written and tested, we found a new field that was needed to ...
1
vote
2answers
257 views
Test Error: JSON2Apex method does not exist
Error:
Method does not exist or incorrect signature: JSON2Apex.parse(String)
I used https://json2apex.herokuapp.com/. I got back APEX and a test class that should work. I am getting the above ...
2
votes
1answer
2k views
What is wrong with this query? (Unknown error parsing query)
When I run the following query in query editor I get this error.
Error
Unknown error parsing query
Query
SELECT Id, OwnerId,Account.OwnerId
FROM Contact where OwnerId = Account.OwnerId limit 100
...
0
votes
2answers
1k views
REST JSON response to VF page
I'm trying to parse the json string into meaningful data over a VF page.
Here's where I'm stuck...
public class callApi{
private final String serviceEndpoint= 'http://XXX';
public String Response {...
3
votes
2answers
1k views
Map one xml to List of SObject?
I am quite new in Xml parsing.
i am having a XMl
<company>
<account>
<id>8c98a6be</id>
<label>4356</label>
<reference>4356</reference>
</...
6
votes
2answers
107 views
Corpus Analysis for Salesforce?
I am asking this question here instead of Stack Overflow because I believe it has relevance to other Salesforce developers. If I am mistaken and this post starts racking up close votes, I will move it ...
2
votes
1answer
3k views
Illegal Value for primitive when trying to parse the json data
I am facing the issue like "Illegal Value for primitive" when trying to parse the json data.Below is the Json Response which i get from a service.
[{"revenue": {}, "emails": [{"grade": "A+", "type": "...