If the bot is talking about Glide • Transform JSON column then it’s not very useful since the array can be of dynamic length. Also I don’t want to extract each key of each object manually.
let json = JSON.parse(p1);
return json.data[p2].date;
In my example, I just pasted your JSON into a template column. Obviously you’d need to get it into the table in some other way, and you’ll need enough rows in the table to cover the maximum number of points on the chart.
@Darren_Murphy Thanks for jumping in to help once again. Your solution seems solid however there are a few issues, because I accidentally omitted some important information you’d need.
As I understand it I’d have to create a new row in the Helper table for each array item. The arrays have a dynamic length and would have at least 1000 items. That’s a low of rows that I’d have to create manually. On top of that it’d basically make it mandatory to use your Enterprise plan since it’d eat up a lot of my row quota. That’s a big price to pay for a simple chart.
Also, the API response would be unique for each user, so I’d probably need to add a row owner, which means i’d need to make the 1000+ rows for each user (manually?). This severely limits how many users can use my app before I hit the row limit you have.
Maybe I’ve misunderstood something about your proposal, but it doesn’t seem suitable for my application.
That’s not a problem. Write the API response into a User Specific Column, and all users can share the same 1000 rows.
If the 1000 rows is an issue, then you’d probably need to look at something like quickcharts in combination with an external code column. Quite a bit more work, but doable.
But I’m having a hard time getting it into my helper column. If I do a Lookup I get all the API responses for all users. How can I get just the current user’s data from the invoices table?
That’s a row owner column, it’s not a user specific column. And it looks like you have multiple rows for the same user?
Maybe clarify that first - should each user have only one row in your Invoices table, or multiple?
If multiple, which of their rows would you want to process?
Ideally, each user would have multiple rows in the invoices table.
I’m rendering all invoices as a Table in the UI that renders all items in the collection.
When an item in the table is clicked the users would go to the Details view and see the API response as a chart for the specific invoice.
If this isn’t possible then I need a way to limit users to only upload one invoice per user. The API response for the uploaded invoice should be rendered as a chart somewhere in the app.
In your Invoices table, add a Single Value column. This should take First → Whole Row from your Helper Table
Now in your Helper Table, add a User Specific Text column.
Then add a Single Value column that targets the previous column. (this will apply whatever value is in that column to all rows in the table).
Now, create a custom action for your Invoice list:
– the first step should be a Set Column Values through the Single Value → Whole Row column, and you want to write your JSON into the User Specific column.
– and the second step will be a Show Details Screen → This Item
The result of the above is that every time a user clicks an Invoice in the list, the JSON for that Invoice will be written to the Helper Table, and the chart data will be created. Then you can just add a chart to your Invoice Details screen, using your Helper Table as the source.
At the moment I just pasted the response there so that I can test things. What I’m struggling with is this part:
– the first step should be a Set Column Values through the Single Value → Whole Row column, and you want to write your JSON into the User Specific column.
Where do I configure the Set Column Values action? When an item is added to the list?
I’m assuming that you are displaying your Invoices as a list or collection, right?
The default action on that list/collection will be Show Details Screen → This Item
What you need to do is replace that action with a custom action as I described earlier…
The idea is that every time a user views an invoice, the value in the Helper Table User Specific column is updated, and the chart for that invoice is dynamically built.