# How to parse CSV into a collection

**URL:** <https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198>\
**Category:** Ask for Help\
**Tags:** actions, tutorial, custom-code\
**Created:** [June 2, 2025, 9:48am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198 "2025-06-02T09:48:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 9:48am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/1 "2025-06-02T09:48:33Z")

</div>

Each of the column inside my row has this data which is parsed from a csv file as shown in the image

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/1/d1bd5768f445f65e08af02f94eaa475034aafd33.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/3/b34b45515c22e5c3f1fb927af45c99b4378acf48.png)

Now, I want to make these seperate objects like

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/4/74735c7b6ea1201e56d1b335c8a524add8419773.png)  
How can I do this such that it will become like a collection which I can create a table of.

I am uploading and creating transactions tables, this app is like a transaction history app here the users upload their csv files of transaction reports

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 2, 2025, 9:58am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/2 "2025-06-02T09:58:27Z")

</div>

Pass the HTML source to a CSV to JSON column. You can then use that to add new rows, either with a workflow loop, or by preparing a JSON body and sending to the Glide API.

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 10:07am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/3 "2025-06-02T10:07:34Z")

</div>

Can you please explain how I can do this? as I have tried converting to json and I am on explorer plan so I can’t use Glide API and I want to show it as a simple collection table

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 2, 2025, 10:10am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/4 "2025-06-02T10:10:19Z")

</div>

If you’re on the Explorer plan, then the API is not an option. So you would need to use a workflow. Below is a video done by a different Darren, that demonstrates one way to do it.

> [@CSV uploads in your app](https://community.glideapps.com/t/csv-uploads-in-your-app/81761/5):
>
> Huge thanks to @Darren_Murphy for helping me streamline this! It works much better and is a simpler setup. [Link to the video](https://www.tella.tv/video/cmafm6m77000x0bl48cd6hl6a/view)

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 10:32am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/5 "2025-06-02T10:32:45Z")

</div>

Yes, I like that approach and it would work but it is quite costly as my program’s main functionality is to store transactions data which is a lot like 100 rows usually and in 250 updates I cannot manage that every time as there will be about 30-40 users using my app for uploading their transacitons in the testing phase and if we choose to pay-to-go option its still not worth it as we are providing this for free and is for our own company.

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 10:34am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/6 "2025-06-02T10:34:24Z")

</div>

Is there like a way when we create a relation we get objects coming. Can we not replicate those types of objects by using json directly and not involving a lot of Add Rows, I want it to be specific for each row like I have the data there should be a way to just convert each json array into the glide type object

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 2, 2025, 10:53am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/7 "2025-06-02T10:53:28Z")

</div>

If you just want to store the JSON, then expand it into a list when you want to view it, then yes that is possible. Essentially you need a Helper Table with numbered rows, temporarily write the JSON into the Helper Table, apply it to every row, then extract the items into rows and columns using a combination of Query JSON & Single Value columns.

Take a look at the “[Miracle Method](https://community.glideapps.com/t/transpose-columns-to-an-inline-list-the-miracle-method/32766)”. It describes the basic approach.

If you need more detailed instructions, then it would be useful if you could provide a sample of your JSON.

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 11:36am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/8 "2025-06-02T11:36:54Z")

</div>

Here is JSON structure, usually these JSONS include about 35 values but to showcase I have shared you the transaction json which includes only 2 values. I want to preview them as a table

```auto
[
  {
    "Transaction date": "14-Mar-25",
    "Value date": "16-Mar-25",
    "Transaction reference": "000452055733.AC0003.",
    "Description": "Service Fee|000452055733",
    "Debit Amount": 10,
    "Credit Amount": "",
    "Balance": 508.04,
    "Account number(IBAN)": "MU07MCBL0944000452055733000USD",
    "Account number(BBAN)": 452055733,
    "Account name": "Current Account",
    "Currency": "USD"
  },
  {
    "Transaction date": "14-Mar-25",
    "Value date": "16-Mar-25",
    "Transaction reference": "000452055733.AC0003.",
    "Description": "Tax Amount Due",
    "Debit Amount": 1.5,
    "Credit Amount": "",
    "Balance": 518.04,
    "Account number(IBAN)": "MU07MCBL0944000452055733000USD",
    "Account number(BBAN)": 452055733,
    "Account name": "Current Account",
    "Currency": "USD"
  }
]

```

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 11:37am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/9 "2025-06-02T11:37:51Z")

</div>

I am looking for something like this for the transactions json

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/b/4b72388c707af2564c86ddec7634514d01a0d455.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 2, 2025, 11:58am UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/10 "2025-06-02T11:58:19Z")

</div>

Your sample JSON does not appear to correspond to the sample table in any way.  
I don’t see any of “Name”, “CSV Name”, “Created At” or “ID” in the JSON data.

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 12:01pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/11 "2025-06-02T12:01:56Z")

</div>

In sample I showed the type of table design I want

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 12:03pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/12 "2025-06-02T12:03:07Z")

</div>

The main thing is to just convert the json into an object somehow like the one we get when using relation

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 2, 2025, 12:36pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/13 "2025-06-02T12:36:49Z")

</div>

A relation doesn’t return an object, but anyway…

Here is a simple example using your sample JSON:

 ![CleanShot 2025-06-02 at 20.34.03@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/4/44c547ec5d3bd4280e829231fb2104315d5968e5.png)

To extract each attribute into a separate column, I used a JavaScript column like so:

```auto
const json = JSON.parse(p1);
return json[p2]["Transaction date"];

```

 ![CleanShot 2025-06-02 at 20.35.49@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/1/0179ee60668f2c3d6466b6769467daa83a4509d2.png)

To get your table, you would use this table as the source of a table collection component.

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 1:23pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/14 "2025-06-02T13:23:26Z")

</div>

Yes,I love this approach thank you sir – But still I have one last issue now, If I am not wrong if I use a new helper table which has its data filled when we open a specific transaction then this will have quite a lot empty rows when the I go from a large transaction (Transaction having 10 or more vals) to a small transaction (like a transaction having 2 vals)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 2, 2025, 1:25pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/15 "2025-06-02T13:25:57Z")

</div>

That’s fine. Just add enough rows to cater for the largest transaction size.  
The key is that your JSON should be written to a User Specific column. This will allow for multiple users viewing data at the same time, using the same rows.

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 2:18pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/16 "2025-06-02T14:18:44Z")

</div>

I have created this perfectly and now it shows proper rows and tables everything like I want but how I can add the data inside the helper table now when the item (transaction) is clicked

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 2:24pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/17 "2025-06-02T14:24:28Z")

</div>

please also explain how will it be cleared and replaced by a new one when we click another item

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 2:24pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/18 "2025-06-02T14:24:37Z")

</div>

I will be really thankful to you

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 2, 2025, 2:27pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/19 "2025-06-02T14:27:26Z")

</div>

I will assume that you have User Profiles configured.

- In your Users table, add a Single Value column and target First-\>Whole row of your Helper Table
- Ensure you have a User Specific text type column in your Helper Table.
- Modify the default Item click action on your Transactions collection, make it a custom action with two steps. The first step should be a Set Column Values action. It will write the JSON from the selected transaction into the User Specific column in the helper table via the User Profile single value column. The second step will be a Show Details screen.
- In you helper table, add a Single Value column that takes the value from the User Specific column and applies it to all rows. Refer to this column in the rest of the table (when unpacking the JSON).

---

<div class="post-metadata">

**Author:** ![Maazsaeed](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maazsaeed/32/90243_2.png) [@Maazsaeed](https://community.glideapps.com/u/Maazsaeed)\
**Post date:** [June 2, 2025, 2:36pm UTC](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198/20 "2025-06-02T14:36:34Z")

</div>

Woah! That’s some awesome logic I could have never thought of this. Hands off to you man – Hope you will be successful in your life. I am really grateful to you for helping me

[Next page](https://community.glideapps.com/t/how-to-parse-csv-into-a-collection/82198.md?page=2)
