Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

How to upload and parse csv files Topic is solved

Questions related to using nuBuilder Forte.
Post Reply
nadir
Posts: 39
Joined: Mon Apr 21, 2025 7:03 am
Has thanked: 4 times
Been thanked: 4 times

How to upload and parse csv files

Unread post by nadir »

Hello,

I would like to upload and parse csv files. I tried to use input object of type file but it gave a javaScript error. I have posted the error in a previous post. Please provide some guidance on how to implement this feature. I did not find any helpful topics in the forum

Thanks,
Nadir Latif
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: How to upload and parse csv files

Unread post by kev1n »

Hi Nadir,

I've responded to your initial post regarding the JavaScript error — feel free to check there for more details.

In this thread, it sounds like your main goal is to upload and parse CSV files after resolving the upload issue. Could you please clarify what kind of parsing you're looking to do? For example, are you aiming to display the data in a table, insert it into a database, or process it in some other way?
Once I understand your use case a bit better, I'll be happy to guide you through the implementation.
nadir
Posts: 39
Joined: Mon Apr 21, 2025 7:03 am
Has thanked: 4 times
Been thanked: 4 times

Re: How to upload and parse csv files

Unread post by nadir »

Hi Kevin,

The CSV file contains attendance records. I want to parse the uploaded CSV file, process the data and then store the data in a database table.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: How to upload and parse csv files

Unread post by kev1n »

There's a function called nuImportUsersFromCSV() in nucommon.php that demonstrates how to process a CSV file and import its data into a database table.

You can tell ChatGPT (or any other AI) what your CSV file looks like—such as the headers and a few sample rows—and also describe your table schema, including column names and types. Based on that, it can help you adapt the code to fit your specific case.

Feel free to ask if you need help or have specific questions!
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: How to upload and parse csv files

Unread post by kev1n »

Just checking in—was that info about nuImportUsersFromCSV() helpful? Were you able to get your CSV data imported into the database successfully? Let me know if you ran into any issues or still need a hand!
nadir
Posts: 39
Joined: Mon Apr 21, 2025 7:03 am
Has thanked: 4 times
Been thanked: 4 times

Re: How to upload and parse csv files

Unread post by nadir »

Yes I was able to get the CSV data imported. Thanks
Post Reply