Questions tagged [csv]

A comma-separated values (CSV) file stores tabular data (numbers and text) in plain-text form.

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

CSV parser for records with relationship

I am parsing records from static resouce csv and want to handle related objects like Account and Contact, for example. My main point is how to handle relared records? Know i am creating map to keep ...
0
votes
1answer
24 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
1answer
18 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
1answer
16 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 ...
-2
votes
1answer
65 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
1answer
34 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
1answer
39 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
1answer
19 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 ...
0
votes
0answers
23 views

Integrate Salesforce with SFTP [duplicate]

How to integrate salesforce with SFTP through rest api? I need to send csv file to SFTP. Please suggest.
0
votes
1answer
62 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
0answers
21 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
1answer
25 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
1answer
26 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.
0
votes
1answer
45 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
2answers
99 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 ...
1
vote
2answers
344 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
1answer
299 views

Apex csv file generation

Hope everyone is safe. I'm trying to generate a csv file using apex code. From salesforce I just want to take out all payments from payments object that have a status of Paid and then check if Number ...
0
votes
3answers
45 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
1answer
81 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 ...
0
votes
0answers
86 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
1answer
54 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
1answer
54 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
1answer
23 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
0answers
4 views

How to perform restore sobject operation and verify it ? For me it gives the below error when checked for successfulResults

I created a job to perform restore operation of the Account sobject's sub-object like Account ->TestAcc, when I passed a modified csv file as payload , it shows 201 created status which says the ...
0
votes
0answers
40 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
1answer
40 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
0answers
305 views

Einstein Analytics Data Preparation CSV symbols error

in my prep for the SF Einstein certification I've been working on the "Einstein Analytics Data Preparation Specialist" super badge. I'm on step 3 and I'm getting the following error: I've ...
0
votes
1answer
142 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/...
0
votes
1answer
184 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) . ...
1
vote
0answers
308 views

Empty Column in Csv , when exporting data as csv using Lwc component

I'm very new to salesforce and lwc , i'm trying to Export some static and some dynamic data in a csv using LWC Salesforce and succeeded in that( except with a new column has been added from the ...
0
votes
1answer
161 views

PapaParse - Want to ensure Chunks processed in sequence. Apex response need to fire next processing sequence

How can i ensure when first Chunk inserted in SF then need to fire second chunk to make sure sequential processing? I am able to chunk the records in SF and format accordingly but need to insert ...
1
vote
1answer
84 views

Email Attachment as CSV issues

if I run this code in developer console, I receive the attached csv in an email. However the output of the code is javsscript code instead of the data String ReportId = '00O3300000331x3XXX'; ...
0
votes
1answer
323 views

Convert XLSX into CSV in Apex [closed]

We are having some hard time converting a ContentDocument of type XLSX into CSV inside Salesforce APEX code. What we are looking for is a way to convert the stored XLSX file into SF to be converted ...
0
votes
1answer
25 views

CSV with autofit column from lightning component [closed]

I am exporting csv from lightning component. But I need to ensure that column in autofit as per the column data when downloaded. Thanks
-3
votes
1answer
204 views

How to format Excel Column in Apex? [closed]

I'm sending an email via scheduler class with an excel file as an attachment, but the data in the file does not appear to be in proper format. Please check the following image: The code I'm using to ...
0
votes
0answers
41 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 ...
0
votes
1answer
25 views

CSV date probelm

I am creating the CSV using the batch code. Here is the code Date testDate = 07/08/2020; String monthOfTheDate = testDate.month()+''; String dayOfTheDate = testDate.day()+''; Integer monthSize = ...
-1
votes
1answer
42 views

string.isempty doesn't appear to work when trying to retrieve price list Name

it appears my if statement with String.isEmpty doesn't seem to be working. What i want it to do is check if a price list entry doesn't exist it creates a new one, and if it does it updates that one. ...
0
votes
1answer
43 views

Not Able To Update Price Entries

I am trying to insert products, then those products then create price entries if they don't already exist but if they do exist they update the previous price entry based on the name of the product ...
0
votes
2answers
26 views

Best way to convert SOQL when doing an import of data

I was wondering what would be the best way to convert the below code ,which is importing price book entries, so it doesn't hit the governor limits. for (Integer i = 1; i < csvFileLines.size(); i+...
0
votes
2answers
557 views

How To Check For Duplicates Using SOQL and Apex

I am currently developing a csv importer for our Salesforce to deal with our way of quoting items, and I am currently trying to make it so that if the product has been added in, it detects whether ...
3
votes
1answer
220 views

Dynamic csv generation for a dynamic soql query in apex

When constructing a csv via apex how do we avoid hardcoding the recordString assignment within the query loop? Note I have a dynamic List<String> fieldsList that represent field names. For ...
2
votes
1answer
1k 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 ...
0
votes
0answers
139 views

Pipe delimiter to generate CSV programmatically in apex

I am trying to generate CSV file with the pipe | as delimiter but the issue that I am facing is it is converting separator into &#124; For example, if csv headers are contained in the list shown ...
0
votes
1answer
59 views

What is the difference between supported Salesforce, Apex, and Dataloader text encodings?

If I export a file of Custom_Object__c with a Custom_Field__c (developer console and salesforce page layout displayed) value of: XX – XYZ I receive an exported CSV with: XX � XYZ If I open that ...
0
votes
3answers
323 views

Display Info Message First and then display Error Message on Visual Force Page through Apex

I am using an import CSV functionality using Visual Force Page and Apex through Quick Action Buttons. I would like to show two messages. First is INFO Message "CSV Imported, if any errors are ...
1
vote
1answer
1k views

Parse JSON to CSV and vice versa

I am converting an array of JS object to CSV by using below code downloadCSVFromJson(filename, arrayOfJson) { // convert JSON to CSV const replacer = (key, value) => value === null ? '' : ...
0
votes
2answers
302 views

Encoding and Decoding BLOB due to error 'BLOB is not a valid UTF-8 string'

I try to encode and decode a BLOB in order to avoid the 'BLOB is not valid UTF-8 string' error, but when I encode the BLOB in UTF-8, decode it again and use the .toString-method, I stil get the error. ...
0
votes
0answers
76 views

Even after having the value in .csv file last column , apex is taking it as null and not able to insert that last column field in object

CsvAttach__c csv=new CsvAttach__c(); String[] fieldsData=readArray[1].split(‘,’); For(Integer j=0;j<2 ;j++){ if(String.isNotEmpty(fieldsData[j] && field[j]==‘Subject’){ csv.put(Schema....
1
vote
1answer
209 views

URL to export to csv with parameters doesn't work anymore in Lightning whereas it works well within classic

we use a url like this one to export data from a SFDC report to CSV, by sending parameters : https://www.salesforce.com/?pv0=123&pv2=1/1/2020&export=1&enc=ISO-8859-1&xf=localecsv ...

1
2 3 4 5