Hi everyone,
I have a card with two widgets linked to two referenced tables: Company and Contact. A contact requires a linked company, but I also use a boolean field physical_person on the Company table to represent standalone individuals — essentially an “empty” company record used purely to link a contact, while still keeping real company records intact.
I have a filtered card view where both widgets are shown and the filter is set to physical_person = true. The problem is: when I hit the + button to add a new record from this view, the newly created Company record doesn’t get physical_person = true pre-filled automatically.
I understand this is tricky because the filter condition sits on a field in a referenced table rather than directly on the Contact. The native filter-to-new-record prefill doesn’t seem to propagate through the reference.
What would you suggest to handle this? A few approaches I’ve been thinking about:
- A default formula on
physical_person set to True (but that would apply table-wide)
- A trigger formula on new records
- A custom widget using
grist.docApi to create both records programmatically
Is there a cleaner or more idiomatic Grist way to achieve this? Happy to hear any suggestions!
Thanks
My head went to the trigger formula first. There must be some criteria on the linked record you can use to set the Boolean to true which reliably will trigger the trigger formula.
another option is renaming the field and reversing the Boolean’s polarity, so that the expected value is false if the company is just an “empty” company. Maybe “true_company”? But if you have a similar workflow in reverse elsewhere where you create true companies from a linked widget that option might just cause problems elsewhere.
Interesting, thanks.
But yes true_company (in my design default physical_person=false) is the normal use case.
I setup another page without filtering to have all company including virtual one and display the field physical_person as a boolean in the card.
I also explored Option to Add a New Row Directly as a Card - #5 by Sylvain_Viart
If I could have a button to trigger that –> creating such record just forcing physical_person=true
My question here, is more a UI question, for the final user, not to have complicated way to create such exception.
I expected to have found a very simple way to just have a simpler form to handle create / search / update of such case (physical_person=true). May I should handle it in an external table and offer a migration button on a true_company later if the case happen.
A full copy.
Still thinking 