I’m demoing Glide for a client and want to have certain fields in the edit screen visible based on a relation field in the table being empty or not empty. The issues is that the visibility settings seem not work work properly when based on the relation column but has no issue when based on any other non-computed field.
For example, show Name field in the edit screen when the relation column is empty but hide the name field when the relation column is not empty.
The behavior from Glide is as follows:
The name field is hidden when set to be visible when the relation is not empty but the relation is actually not empty.
The name field is visible when set to be visible when the relation is empty but the relation is actually not empty.
Finally, I’ve testing the visibility condition based off a non-computed field (text field) and it works correctly. I’ve also tested based on a relation being empty/not empty outside of the edit screen and the behavior is as expected.
I’m confused. This is either a bug or something I don’t understand about the underlying function of Glide.
What is the purpose of the relation? What is it matching? Does the content of the relation change when something else changes inside the edit form, or is it established before the form is opened? Be mindful that the edit form lives in a temporary state, so it contains values that have not yet been written to the table. However, there are some undocumented quirks where some things can be accessible.
The relation is intended to match to an ID related to a contact in another table. If the relation populates that means that the record has a contact connected to it and therefore field such as name, phone, and email (contact details) no longer should be editable since those details are linked to the contact that was matched via relation.
I want to have a way that the user can easily edit a lead’s details but can also see whether or not the lead contact may already exist in the database and therefore the user can “connect” the existing contact to the lead record. I would also like to have them be able to “disconnect” the contact from the lead record which would then clear the relation and the basic contact details fields would again be visible in the edit screen.
Hopefully that helps.
Perhaps I am going about the solution the wrong way too. I’m open minded lol
How are you constructing the relation? As Jeff asked above, is there a way in that edit screen for the user to change the values related to the relation?