Aggregation of Records during CSV upload

Hi There,

I am using the CSV upload api service to import some Shopify data. The way that shopify exports are structured, each line item is it’s own line but not all of the order information is copied through. I’m ideally looking for a way to import raw Shopify exports into my database and have each order be its own record. This would be mean aggregating some line items in the CSV into a single JSON record. Is this possible or will I need to set up a series of steps to accomplish this?

It looks like the concept is possible with multiple columns of the same name with group_columns_by_name functionality but I don’t see anything similar for records.

Hi @Aaron_Alpeter

It seems that using the raw CSV file provided by Spotify won’t work.
As far as I understand, you will need to write code that will transform your CSV file

Regards,
Viktor

Hi Aaron,

I suggest using the following API service from our marketplace to read data from the CSV, process it in your logic to aggregate the records, and then save them in Backendless:

Regards,
Mark

Thanks Mark! That was the goal, do you have any suggestions on the steps or blocks that could be used to aggregate the data?

My initial thought is to create a series of lists based off of the order number, convert those lists into objects, and then save them in the database but with the csv upload tool I looks like I would need to move them into a table before doing that.

Does it sound like I’m on the right track?

The CSV API service provides API to convert CSV to list of objects. You would need to apply your algorithm to those lists of objects to generate the final list that will go into the database. As for the details of the actual algorithm, I do not have a quick answer, this is something you need to figure out :wink:

Thanks! I can take it from here! I assume that you’re referring to the csv2list option

Yes, that’s the one!

I noticed that the documentation for csvtolist isn’t available yet. Is there an ETA on that?

https://backendless.com/feature/csv-to-from-database/#1663457632612-305f1fa4-7249

Not soon. You would be better off getting information by asking questions on the forum.