Each of the column inside my row has this data which is parsed from a csv file as shown in the image
Now, I want to make these seperate objects like
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
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.
1 Like
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
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.
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.
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
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”. 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.
1 Like
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
[
{
"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"
}
]
I am looking for something like this for the transactions json
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.
In sample I showed the type of table design I want
The main thing is to just convert the json into an object somehow like the one we get when using relation
A relation doesn’t return an object, but anyway…
Here is a simple example using your sample JSON:
To extract each attribute into a separate column, I used a JavaScript column like so:
const json = JSON.parse(p1);
return json[p2]["Transaction date"];
To get your table, you would use this table as the source of a table collection component.
1 Like
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)
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.
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
please also explain how will it be cleared and replaced by a new one when we click another item
I will be really thankful to you
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).
1 Like
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
1 Like