function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abilash Kosigi 8Abilash Kosigi 8 

Dynamic CSV File loading into custom objects

I have two csv files with the following dummy data. Whenever, I upload it to the vf page, the apex class should read the first line
(which always contains the custom field names) and store the values in the next lines accordingly in the Account object. The number of of fields in the csv file can change time to time.
We can say that the template of the csv file is dynamic.

CSV File 1:

Account_no, Account_name, Account_branch, Account_City

CSV File 2:


Could anyone please help.
Do you have any code that you have used to attempt the solution?  Do you have any specific questions or issues you are running into while parsing the CSV or generating your Account objects to insert? Writing this code is not a trivial matter and not something that should be done by the people on this board and by people who do not have access to your org.
Vidhyasagaran MuralidharanVidhyasagaran Muralidharan
This could be helpful for your requirement