Controlling column order

AppSheet does its best to automatically order columns in order of importance. If you’re using the Tabular or Grouped List views, or the Table view, you can manually control column order.

After describing how AppSheet automatically orders columns, we describe how you can manually control column order.

How AppSheet automatically orders columns

AppSheet automatically orders columns using these rules:

  • Rule 1. We always show the key because the key, by definition, uniquely identifies each row. Without the key, it is unclear which data entry is being shown. If the key is hidden (by checking the “Hidden” checkbox in the Editor), we don’t show the key and instead show the data left to right. You can read more about how to pick an appropriate key here.
  • Rule 2. Next we add any fields that call for 'actionable' icons (eg: a phone number, email address, etc). AppSheet assumes these items are things you'd want a 'quick click' action on. If Explicit column headers are enabled (in the UX>Style tab of the Editor), we don’t show actionable icons.
  • Rule 3. Then we proceed left to right in spreadsheet column order-- if some columns are more important to you, please move them to the left in the spreadsheet.
  • Rule 4. Many spreadsheets have a rightmost column that is computed by a formula-- eg: cost of items. If we recognize this pattern, we make sure to include this column.

Let’s see how this works in a real app built with AppSheet: a cost estimator put together by a fictional auto repair shop to calculate the resulting total profit from jobs done in one week.

First, let’s take a look at the original spreadsheet-- there are four columns: Service, Total, Cost, and Type.



Once the app is created from the spreadsheet, either through AppSheet’s Google Sheets add-on or straight from AppSheet.com, you can now view it live in the app emulator.

You’ll note that my leftmost column, Service, is showing first in the app. Since the Service column is the first column in the spreadsheet and the items within the column don’t repeat twice, AppSheet chose Service as the key for the app-- so that’s what shows first.

If you click into any of the entries in the app, you’ll be able to see the rest of the columns and data.


 

Manually ordering columns

You can control column order using the Editor's UX>Views tab.

  1. Click the edit icon next to the view whose columns you want to reorder.
  2. Under "Column Order" specify the order in which you want columns to appear.  

Let's see how this works in the Profit Calculator app. 

Originally, the columns were ordered according to the spreadsheet, with "Service" first and then "Total" next. But let's say that you would like to instead see "Type" and "Cost" first.

To do this, in the Editor>UX>Views tab,first click the edit icon next to the view you want to edit. Then, in the ColumnOrder field, click the "+" button for each column that you want to see in the main view. 


Now, the main Table view of my app is ordered the way you intended:

 

From the Table view, if you click on one of the rows, it will expand to show the whole row in a Slideshow view. At the moment, that Slideshow view will not maintain the column order you specified for the Table view. You can set that up separately by creating a Slideshow view for the table, mark its position as 'Ref' (to indicate that it isn't actually shown via a view button but only displayed when referenced), and define its column order as well.

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.