Hello everyone,
I was working on a doc with some forms and encountered a few peculiar issues. After a quick search in the community, I couldn’t find any posts addressing these topics.
There are two points I’d like to share here:
- Applying quick styles to the form layout
- Filtering options based on previous selection
Applying quick styles to the form layout:
For some reason, when creating a form using the Create Form button in the table options, the form layout editor does not display the quick styles as seen in the detail view.
Form layout:
Detail layout:
You need to switch the selection to Detail view, apply the quick style, and then switch back to Form view. When you do this, a warning message will appear stating that the current layout is not compatible with forms. However, you can still edit it normally, and I haven’t encountered any issues with this approach.
There are a couple of other ways to apply a different layout to the form:
- Create a view and customize the layout:
- Create a new view of the table.
- Customize the layout and select the desired quick style.
- Instead of creating the form using the “Create Form” button in the table options, select the recently created layout.
- Modify the visualization type:
- Create a new view of the table.
- Customize the layout and select the desired quick style.
- In the table options, change the visualization type to Form.
Filtering options based on previous selection
There are many cases where, when submitting a form, you may want to filter options based on a selection you’ve already made. To make it easier to explain, let’s consider the following example:
Imagine an asset list that includes the company associated with each asset and the room where the asset is physically located. Each room belongs to a building, and a building can be associated with multiple companies. However, assets are linked to a single company only, even if the building is shared among multiple companies.
In the form, we have two fields: Company (a relation to the Company table) and Room (a relation to the Room table). The ideal behavior would be that when a company is selected, the room field should display only the rooms related to the selected company.
The primary approach to achieve this is by applying a filter in the column options, ensuring that the available options are filtered based on an expression. However, I noticed that in published forms, this filtering only works if the filter references a value from the form’s main table itself.
You cannot use properties from nested related tables. For example, in our case, the Room table is related to the Building table, which in turn is related to the Company table. If we set the filter formula for the Room column as:
Building.Companies.contains(thisRow.Company)
In the published form, this setup won’t work—it will return an error stating that certain relations cannot be accessed, even if the “Include referenced tables” option is checked.
This behavior makes sense because only the Room table is included in the form, whereas the Building table isn’t directly related to the form’s table.
Solution:
A simple workaround to resolve this issue is to add a related column in the Room table that directly contains the companies associated with the selected building. This way, the filtering will work as expected within the form.
Here is the doc that contains this example:
Link to the form: https://coda.io/form/Add-Equipment_d7NkiMNznBp
I hope this can be useful to someone
Best regards,
Arnhold