I have a table that looks like this;
Is there a way for me to write these computed columns to another table that stores by user/date for making a chart/graph? I have several actions I could add a set column/new record to, but I am not sure how to point to a specific record and determine if it exists, and if it exists, how to update it rather than write a whole new record. In my mind, I have a method that should work using relations, but not really sure how to set that up.
So do you want to put the data from these multiple rows into one row in another table?
Yes, one row would be best. As far as I know, I can select the proper column in the table for each graph of things I want to show (calories per day, weight per day, etc.)
Which specific columns do you want to write to another table? Sum, Last Weight and Last Weight Taken?
What does your data structure look like in the destination table?
Not really sure how to structure it is the thing. I know i’m going to need some relations but… I basically want the computed column of the total calories and weight for each day. Later I may add a column for the water consumption and et cetera. Start small and go big is what I always say. What do you always say?
So it’s the “Sum” column?
What I would do, for future scaling purposes, is to:
- Create a template column in the table where you have the screenshot, something like:
- In your Users table, create a joined list column that will join the key-value pairs, separated by a comma and a newline character.
- Add a template column to convert it to the right JSON format.
Now you have something like this.
And can submit it to a new table as a single cell.
Then, you can use the Query JSON column to query the parts you need.
That way, you don’t need to care about the row orders changing, or much work if you add a new row in the Actions table. Just need a new query JSON column in the destination table to query that new row’s key.
I appreciate the sleekness of this. But I don’t know j s. And so if I change anything in the future it’s sure to break. I was kind of hoping for a glide solution. Also, this particular app is a free app and i’m not sure j s is supported?
OK, thank you for the clarification. Obviously, I don’t know much about either. I will give it a whirl.
Thanks again @ThinhDinh. I was/am intimidated by this because I’ve never done it. @Darren_Murphy said it is available on the Free Plan. I will give it a whirl. That’s how you learn, right?
Yes, the Query JSON and JSON Object columns are available on all plans.
Query JSON uses JSONata. If you’re not familiar with JSON, that could be a good place to start. They have a sandbox with lots of sample data to play around with, as well as all the documentation.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.