A Grid is a matrix of DataSets and Fields (Rows and Columns). In contrast to a List field, each cell has a unique ID that can be used in expressions/formula elsewhere in the application. This Field type will NOT follow the principles of ‘responsive design’ but will show a horizontal scroll bar at the bottom of the grid. Common uses of a grid field are financial tables and milestone tables.
When creating a grid field a key point to remember is that the label isn't shown in the workspace, but is still useful to have if you want to search for it in your fields. Another point is that when choosing your identifier its best not to make it too long because if you want to reference an individual cell in an expression it will be will make it longer and harder to understand (especially if its a long-expression).
Orientation determines the way data sets and fields are laid out as rows or columns. Orientation is not permanently set so can be changed after the field is created.
Vertical means that fields are horizontal (Rows) and datasets are vertical (Columns):
Horizontal means that data sets are horizontal (Rows) and fields are vertical (Columns):
Hide grid row titles means that whatever is entered into the label for the field or dataset (depending or orientation) will be hidden. This can be used to increase the horizontal visibility of the grid field seen on screen
With row titles:
Hidden row titles:
For each Field in an App, you can set a property on the Field to 'Exclude This Field From Templated Record Copies' If this has been set for the certain Fields and you choose to use a Templated Copy, it will not copy the values from these Fields when it copies the Record.
Datasets are quite simple, a field determines what type of cell a row/column will be while a dataset determines how many there will be. For the example above (horizontal Grid field) a dataset is a row and each row represents a checklist item, the more datasets the more checklist items. The label would show alongside each checklist item, for example, dataset 3 could be 'Train Personal'. In the example above they have been named as sections 1, 2, 3... This because it has been chosen to hide the labels and have the checklist item entered into a text box as it has better visibility.
The identifier works as normal but it can be auto-filled in based on the label like individual field identifiers.
Tip - Again try and keep the identifier small so the cell identifier isn't too large
Note - Datasets can only be added and removed in the app studio field, they can not be added in the workspace as a checklist can.
Fields are a bit more complicated but work very similar to creating an individual field. The label and identifier work the same as they do on datasets. The type of field is limited more than creating an individual field, current fields that are suitable for use are:
- Long Text
- Person by Team
- Image List
- Date Time
After this, it shares the same principles of adding a new standalone field
In a grid field, you can set expressions in each cell of a grid field so if there are 5 datasets and 4 fields there will be 20 cells. This is located at the bottom of the field. These expressions work the same as they do in individual fields. Click here to see how to create expressions
Header Text is a box at the bottom of a dataset or a field (whichever represents the row on the grid). When you enter a value into the header text it will appear above the row, for example, 'Not Required.
If horizontal orientation it can be found in the dataset:
If Vertical orientation it can be found in the field:
When referencing a grid field cell in an expression it comes in the format of [GridIdentifier_DatasetIdenifier_FieldIdentifier] so making the identifier standard and easy to read will help with future use of the grid
When working on a lot of expressions it can be difficult to keep up with the changes you've made so we have added a state column that shows you which ones have been modified. For a quick way to add multiple generic expressions in one go check out are grid field expression template article here.
If you have a particularly big grid field with a lot of cells then you can search for expressions quickly using the search tool as see below
- When creating a grid that is mostly made of expressions its best to put the expression in sets of 5 or 4, then saving and repeating this process. If you put them all in in one go and there is an error it can take a long time to find the error
- If you're creating a checklist, milestone tracker or similar grid fields its better to use a standard identifier like 'I01' for item 1 or 'S01' for stage 1 instead of something like 'TrainPersonal' or 'Definestage' as its easier to reference and if you change the field you don't need to change the identifier
- A common issue when trying to save a field and it failing is that the dataset and field identifiers aren't valid i.e. there is a space or invalid character.
- If you are going to use this grid on a mobile or tablet its best to test it first because screen sizing can have a big impact usability
- If you're making a big checklist that is going to be filled in over a long period of time, instead of separating out large sections using a header it can be better to make them in different grid fields as its easier to reference each section/stage and you can put them in separate templates, this means you don't have to see the parts of the checklist that isn't relevant
Make sure to click the 'Save' button when making any changes in order for them to be added to the next app version. Once you have made all the changes you need to an application you are then ready to publish it to workspace.