Questions tagged [parsing]
The parsing tag has no usage guidance.
63
questions
0
votes
1
answer
63
views
Parsing JSON IN Data Extension - SSJS
I'm trying to parse JSON data stored in a field (Product2) within a Salesforce Marketing Cloud Data Extension and then upsert the parsed data into another Data Extension. I've written a Server-Side ...
1
vote
1
answer
233
views
SSJS script is timing out at 30 minutes. How to I build series of scripts using rownum to parse the DE sequentially?
We have an SSJS script that is calling an API to fetch price of items and writing it into a DE. The API call is taking time and in 30minutes the script is only able to retrieve the price for ~6000 ...
-1
votes
1
answer
29
views
Help With Parsing Wrapper Class For Xero Contact
I am trying to update a Xero contact with Payment Terms when a salesforce account is updated. I extracted the json for a contact using Postman and then used json2apex to generate the wrapper class. ...
0
votes
1
answer
103
views
Parse XML fails with NullPointerException when attribute is xlmns only
I got a sample XML like this:
<?xml version="1.0" encoding="UTF-8"?>
<RootNode>
<Sample1 xmlns:key1="yyy">
<Sample11>ABC</Sample11&...
0
votes
1
answer
51
views
Apec Class Issue when parsing a text string back to a record
I have a LWC that essentially collects data in a table format.
I am then using an apex action (apex class) to parse the text string output of the LWC back to a record - see the code below:
public ...
1
vote
0
answers
161
views
problems with adding Child node to existing XML elements
I am trying to parse html in apex class using XML Parser Document and XML Nodes classes.
At one point I need to add another xml which is present as string with me to one of the nodes as child node in ...
0
votes
1
answer
937
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
2
answers
2k
views
How to parse JSON correctly using nested wrapper classes? [duplicate]
I'm trying to parse multiple invoices converted to nested JSON that is coming from the rest service. Here is how it looks like:
{
"files": [
{
"bill_from": &...
0
votes
2
answers
176
views
How do I insert a data extension variable immediately after an "="?
So within my email, I can call a data extension field:
%%User_Type%%
When previewed, this displays as either "Free" or "Premium" depending on the user.
For data tracking via google ...
-2
votes
1
answer
314
views
JSON parsing object/array
I am trying to parse JSON but an error comes when the data comes in array format, I tried to typecast the untypedMap in Object and used instanceof to check if it is Map<String, Obejct> or List&...
0
votes
0
answers
33
views
Working with a JSON array with inconsistent Type returned from a callout
I am making a callout and getting a JSON array in return. My initial thought was to use an Apex Wrapper class and deserialize. Because I need to do some transformations with the values and display ...
-3
votes
1
answer
77
views
Find text between @ and Space in a Message with Process Builder [closed]
I have text that is something like this:
sample text @dave more sample text
I need to just parse out and find "dave"
To clarify, I just have not used LEFT, RIGHT and LEN much so I am ...
1
vote
1
answer
327
views
Can't parse JSON properly - access to inner list values
for two days, i am trying to figure out parsing of following json.
[
{
"name": "Czech Republic",
"alpha2Code": "CZ",
"...
0
votes
1
answer
531
views
I'm getting wired error when trying to connect PDF.js to my LWC
I'm doing a little project - the idea is, I am given Invoice pdf file and I have to parse that to JSON so that I could insert invoice data into Opportunity and OpportunityLineItem. I'm using PDF.js ...
0
votes
1
answer
133
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,
...
1
vote
1
answer
989
views
How to process papa parse results in apex class
Folks,
I want to parse CSV files with papa parse in apex. I have a lwc to upload the file and a custom apex class to massage the data and insert results to custom object. My question is what do I ...
0
votes
0
answers
383
views
Weather API callout issues
I am currently working on creating a prototype LWC that gives weather information for a given location. The location is being provided via user input. For some cities, it works fine - as in the case ...
0
votes
1
answer
648
views
Help with storing JSON data [duplicate]
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
1
answer
136
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
0
answers
227
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
1
answer
1k
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
2
answers
2k
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
1
answer
62
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
2
answers
1k
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
0
answers
2k
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
2
answers
58
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
1
answer
260
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
1
answer
5k
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
0
answers
32
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
1
answer
988
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
1
answer
2k
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 ...
1
vote
3
answers
21k
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
1
answer
162
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
1
answer
1k
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
1
answer
2k
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
2
answers
203
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
1
answer
2k
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
1
answer
556
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
1
answer
2k
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
1
answer
3k
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
2
answers
471
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", <-- ...
3
votes
1
answer
13k
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
1
answer
7k
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
1
answer
522
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
1
answer
101
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
2
answers
7k
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 ...
1
vote
3
answers
533
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
0
answers
91
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
2
answers
484
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
0
answers
275
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 ...