Questions tagged [csv]
A comma-separated values (CSV) file stores tabular data (numbers and text) in plain-text form.
270
questions
0
votes
0
answers
91
views
Bulk API 2.0: Can I insert AND upsert in one csv request?
Edited to clarify:
Background info on what I'm working on – we're going to be receiving email lists from clients, and we want to create new Leads or update existing Leads in Salesforce with the info ...
1
vote
4
answers
986
views
Can't read CSV file using data Loader 59
I tried all three suggestions from another question asked in this community
"Data loader CSV Error: Can't read from CSV file"
and none of those answers solved my problem.
I just loaded Data ...
0
votes
1
answer
62
views
Salesforce API SOQL - Exporting data as CSV [duplicate]
Is it possible via Salesforce SOQL API to get the results in CSV rather than JSON?
Example of the call I am making (via Postman for testing)
GET /services/data/v51.0/query?q=SELECT id,name,profile....
0
votes
0
answers
96
views
CMDT CSV Insert Problems
Am trying to insert new records for a custom metadata file and saw that force:cmdt:record:insert has been deprecated. I tried sf cmdt generate records --csv path/to/my.csv --type-name MyCmdt but VS ...
3
votes
1
answer
1k
views
How to calculate how much storage a CSV will use when uploaded to SObject
So I have a .csv file that contains ~12,000 rows and on my local filesystem takes up about 3MB of data. I assumed that when I imported this csv into a Salesforce Object, the data would still take up ...
1
vote
1
answer
400
views
PapaParse in LWC after Winter '23 heightened security?
I am trying to use PapaParse (a Javascript CSV analyzer library) in a Lightning Web Component. A lightning modal hosts the tool. Although I have seen examples of doing so in the past, I have been ...
0
votes
1
answer
549
views
How to save a csv file to folder
I needed to do generate a csv file and save it to salesforce folder every day at 08:00 AM.
So i did the generating a csv file every day at 08:00 AM with:
public class TrucksExport implements ...
0
votes
0
answers
20
views
How to parse CSV file containing line breaks within the CSV cells using Apex [duplicate]
I have a CSV file uploaded in Salesforce Document, That CSV contains line breaks within the cell. So when I try to parse this CSV file with "csvFileContent.split('\n')", I am expecting all ...
0
votes
1
answer
262
views
Can I convert a JSON property (not full JSON) to csv with DataWeave without parsing it first to an Apex class?
It's been very easy with DataWeave in Apex to convert a JSON to a csv.
However, I'm getting a JSON from a REST call, and the part I'm interested in is located in the "data" property, ...
-1
votes
1
answer
107
views
Nested Json response to csv conversion
I got this response from API however I couldn't be able to parse name because of the nested objects, example this is my query trying fetch permissionSetAssignment records from one org to other in ...
1
vote
0
answers
155
views
Apex - PageReference - Report URL
When our org was in classic, we had the below code which used to save a report as an Attachment. This has worked for the past 7 years...
PageReference reportLink = new PageReference('/'+reportId+'?...
3
votes
1
answer
930
views
Escape Comma in Column While Creating CSV in LWC
I need to escape comma in Column values while Creating CSV file in LWC. I tried with replacing comma with Keywords but still when converting string into blob it splits value with comma. I'm sending ...
0
votes
2
answers
138
views
how to take single field value when use the ',' in field value in csv file
for(sObject sObj : scope) {
AggregateResult ar = (AggregateResult)sObj;
Integer IdCount = (Integer)ar.get('cnt');
String accName = (String)ar.get('accName');
...
0
votes
1
answer
561
views
Can you chunk a csv file by passing the parsed file to a Batch Class?
I have a class that is parsing a csv file but running into heap limits. To resolve that I am converting it into a batchable class. However the List of lists is not getting accepted. I am getting the ...
0
votes
1
answer
19
views
Modify string value in soql list and add back to list
I have a VFP which functions as a CSV download. In my controller I return a simple SOQL list from a custom Customer object. I need to modify the Name being returned to remove all commas and then add ...
-1
votes
1
answer
765
views
Converting CSV to an APEX List [closed]
I have a csv file downloaded with 1 column listing about 3000 names. What is the simplest way to grab all these names and store them in a List to be further manipulated in Apex?
Thanks!
1
vote
1
answer
863
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
1
answer
3k
views
Generate CSV , EXCEL file dynamique with lightning web component
I have a problem with my code , I want to generate a file ( CSV / XLS ) , but with my code I get nothing , I don't now what is the problem .
Some help please .
<a target="_self" class=&...
0
votes
1
answer
120
views
Creating records from csv is running twice
I wrote a lightning component that reads a csv file and creating records with relationship, e.g opportunities and their related contacts in each row. some of the contacts already exists in org ...
0
votes
1
answer
621
views
RecordTypeId not getting uploaded from csv file to Salesforce org using SFDMU tool. Error: Value does not exist or does not match filter criteria
I am using SFDMU tool (Salesforce Data Loader SFDX Plugin) to upload csv data files to a target salesforce org. I have 3 records A, B and C in an object in a hierarchy. Record B is in a self-lookup ...
-2
votes
1
answer
232
views
Dataloader Insert Problem
I'm trying to insert an Excel data in my org via Dataloader. But, when i try to use INSERT with the .csv file, i can't find the 'State__r:State__c:Code__c' in the mapping field.
Error> State: id ...
0
votes
1
answer
2k
views
How to create a test class for apex that reads CSV file
I was trying to test my apex class that gets a CSV file, reads it and creates actual records.
In my test class I tried to convert my CSV string into base64 string. Then I used this line of code Blob ...
0
votes
1
answer
678
views
SSJS Automation Studio - Read imported CSV file
I'm new to SSJS and Automation Studio. What I'm trying to achieve is a simple automation based on the CSV File Drop -
File Drop -> Script
After a CSV file was dropped into a specified location, ...
0
votes
1
answer
683
views
How to split csv string
I am using dataloader and retrieve data like that:
"0017Q000003T1EdQAK","sForce ""Test"" ","Some,data","","94087",""
...
0
votes
0
answers
88
views
Is it possible to import IsMasterLanguage field from CSV file in UI import articles feature in salesforce lightning?
Hi guys I am trying to import salesforce knowledge articles from CSV file however I am getting an error that displays IsMasterLanguage column in the header cannot be mapped. So I wanted to know ...
0
votes
1
answer
729
views
convert list of records into CSV file [closed]
I have to create lwc quick action to convert related contacts in to csv download.
I had have creating lwc quick action button and retrieved the data needed. There is problem in converting to csv.
I ...
0
votes
1
answer
780
views
Insert record from static resource csv
I have csv file with account records and want to insert that records via apex. How can i do it and dynamically find necessary fields? I can only manually assign them and its hard to parse cause of ...
0
votes
2
answers
4k
views
Export data and download file
I am exporting some data into csv from org and want to download that file. Now i can just send it to email. Any ideas?
List<Account > acclist = [Select id,name , CreatedDate , lastModifiedDate ...
0
votes
1
answer
398
views
How to remove all unicode characters from a blob?
I have a requirement to parse the contents of a csv blob which has unicode characters. When I am trying to parse it using
Blob myBlob = EncodingUtil.base64Decode(response.getBody())
I am getting an ...
0
votes
1
answer
3k
views
How to parse a CSV file into JSON using APEX?
I am getting a CSV file as a Blob in response to one of the callouts. I need to parse this CSV file and convert the contents into a flat JSON structure. Is there an inbuilt way to parse CSV in apex ?
...
0
votes
2
answers
2k
views
'Field Not Found' and 'Required Field' Error Importing CSV to Data Extension
I just tried importing a .CSV file to a Data Extension (there are only 3 rows as I'm doing a test), but I keep getting an error. My CSV files have the right headers that can be mapped, so I'm not sure ...
1
vote
1
answer
512
views
Is there a way to upload/insert a particular custom object record and its related file document from one single csv file using data loader?
Hi it would be great if anyone could help me out with this.
I have encountered a requirement in salesforce where I have to upload/insert a custom object record and its related file attachment into ...
0
votes
1
answer
29
views
CSV file adding default row by using excel
As you can see in the image below I'm trying to open a CSV file by using Excel but every time I tried there is a row that I don't need excel add it by default, how can I remove this option I don't ...
1
vote
1
answer
3k
views
Read a csv file that is stored in Attachment Object
I have an excel/csv as an attachment related to an EmailMessage. I want to read the csv, process the data and create certain records(of custom object) based on that data. I want to understand how I ...
0
votes
0
answers
149
views
Test.loadData is not inserting data for Producer object
I am working on a Data Factory test class and I was able to successfully load relational data for Account, Case, WorkOrder, User, InsurancePolicy and couple of other custom objects by providing Id in ...
0
votes
1
answer
149
views
How to import two values that are in the same excel field separated by a comma
I just got an .csv file that i need to import into my sandbox as a custom object, it looks like this:
The value that is on the left side of the comma should be stored as a field (called Location).
...
0
votes
1
answer
463
views
E-Mail with csv attachment processed in Salesforce [closed]
It is possible to send an email with an attachment to salesforce and that this attachment will be processed there? The attachment contain multiple columns and rows for update or create records.
1
vote
1
answer
834
views
How to force ANSI Encoding on a generated CSV attachement in apex?
I want to generate a csv attachement and force ANSI encoding how can i do that?
Code to create my attachement:
string rows = 'column1;column2;column3'+'\n'+'a;b;c'
Attachment attachment = new ...
0
votes
2
answers
969
views
Handle double quotes in a long text field when generating a CSV file from apex
I have a custom object in which I have a long text area field. I am querying it in apex and building a CSV and sending an email with csv as attachment.
The value in the long text area field and which ...
2
votes
2
answers
3k
views
Parsing large CSV file in LWC
I have implemented the following code to parse a csv file, convert to a JSON array and send the JSON result to apex controller, which invokes the batch class to process the DML operation for ...
0
votes
3
answers
411
views
CPU Limit Exceeded Visualforce Page Controller
I am running into a CPU limit error when processing more than + or - 300 rows from a .csv file, via a Visualforce page/controller. I realize CPU limits can have a lot to do with other items running ...
2
votes
1
answer
761
views
Comparing string in CSV header against expected value yields not equal when debug log shows they are identical
I'm reading a CSV file saved in a ContentVersion
The CSV header looks like:
FirstName,LastName,...
I'm checking to make sure the first line (header row) matches the expected column headers using this ...
1
vote
0
answers
1k
views
Value provided is invalid for action parameter 'fileContent' of type 'Blob'
So, I'm trying to pass a csv file to apex, with a lightning input type file and a button with an onclick that calls to the apex method, receiving a blob variable:
@AuraEnabled
public static String ...
0
votes
1
answer
664
views
Create CSV from SOQL query
I'm trying to download the results from my SOQL query as a CSV, but when I choose "Bulk CSV" the resulting file contains the query itself and not the result set.
List view shows 21k+ ...
1
vote
1
answer
236
views
Searching CSV Data stored in Long Text Field
I am new to Salesforce and wanted to get some guidance on building a solution for the following use case. I am currently working on a Salesforce project building a hotel reservation system for service ...
0
votes
1
answer
42
views
How to exclude leads from an imported .csv file regarding to their job title or any other attribute?
Hello!
I am trying to automate the lead importing process to save some time. Usually what I do whenever we have a list of participants to virtual events (.xlsx), is a VLOOKUP command to find duplicate ...
0
votes
0
answers
489
views
Upload csv files from ftp into SF via Apex (without insertFile Tag) [duplicate]
I want to automatically upload csv files into Salesforce on a regular basis, doing a scheduled job. I want to have this job centralized so that everybody has access to the code and the process. I want ...
0
votes
1
answer
277
views
In my aura component CSV export, double quotes break the export
I have an aura component that exports a list of cases to a CSV. In the description field, customers have been inserting double quotes in the field (example "variable") which breaks the ...
0
votes
1
answer
1k
views
Convert list of object to CSV string
I'm using the d3 library trying to do a geo chart with LWC. To do so I need a csv file with my values in it like the example bellow
var promises = [];
promises.push(d3.json('d3js/map-population/...
1
vote
1
answer
956
views
Issue with Export to Csv when name consists of comma
we are trying to export data into csv file using Apex and Visualforce page in Salesforce .
The data is being exported but we have an issue .
Here we are exporting record from an object(Text Fields) .
...