I am trying to make an app that essentially works like a calculator spreadsheet but with a nicer UI- I have a bunch of inputs in one view and then the resultant data in some other views.
I'm having an issue where I have a formula to calculate the value of a variable for 1000 rows of a table, based on the values I input (this is done via editing a detail view), and the table in my data view is not updating.
When I go to edit a row of the table, the value is correct (and uneditable because it is determined by a formula), but I would have to go through all 1000 rows and save them manually to have the overall view up to date.
How can I make the table view update by itself every time I change the inputs?
For a given row, all column formulas are recalculated upon a data change to any column in the same row. Using this concept you can add an additional column in your table of type Number and name it for example Refresh.
After that you can build an action that updates this column with a simple change like incrementing its value, with a formula like [Refresh] + 1. Then you can simply launch this action on all rows, and all other columns will be updated .
I've managed to create a refresh action, but can't work out how to apply it to all rows, could you explain how I would do that?
Also, would this solution work offline? I've got an app built that does what my spreadsheet does, but I'm finding it frustrating that it has to communicate with the sheet to do simple calculations.
The aim of what I'm doing now is that it call all be done instantly by the app with no sheet required, and no connection required.
but can't work out how to apply it to all rows, could you explain how I would do that?
The user can manually select the rows and launch the action, or you can build another action that launches the refresh action on all or on a set of rows. There is an action type called: Execute an action on a set of rows, this is what you should use in the latter case.
Yes it should work offline. A copy of the whole database (taking into account the security filters) is downloaded into the user's device. Any updates will be written locally, then synced with the server once Internet connectivity is available.
Thank you for clarifying- I've got an action set up to do that, but I can't work out how to apply it to all rows. I've tried using REF_ROWS("Data","Row ID"), since that seems to make a list of all the rows, but then when I run the action it has no effect. What do I need to input to the 'referenced rows' field?
For all rows, your formula should be: tableName[keyColumnName]
User | Count |
---|---|
15 | |
12 | |
9 | |
8 | |
4 |