twentyhq / twenty

Building a modern alternative to Salesforce, powered by the community.
https://twenty.com
Other
23.08k stars 2.42k forks source link

Introduce expressed fields #7692

Open ijreilly opened 1 month ago

ijreilly commented 1 month ago

We would like to offer the user the possibility to create field expressed as a function of other fields belonging to the same object (excluding relations). For example, object Company has fields numberOfEmployees (type number) and salariesExpense (type number), we could introduce a field averageSalary that would be: salariesExpense / numberOfEmployees. This field would be of type generated and built leveraging typeORM's asExpression as we did for the search.

In a first version

ijreilly commented 1 month ago

@FelixMalfait fyi

Bonapara commented 1 month ago

Not 100% convinced by this feature from a product point of view at this stage. I think we need to build and agree on our global Compute fields strategy first to avoid introducing 3 different field types for formulas/compute fields.

FelixMalfait commented 4 weeks ago

Called "formula" in Clay which I think is the most clear term

Screenshot 2024-10-24 at 08 12 13
ijreilly commented 4 weeks ago

@Bonapara @FelixMalfait is this on hold for now? i thought so from @Bonapara s input

FelixMalfait commented 4 weeks ago

@ijreilly yes I just wanted you to log it but not prioritize it, thanks!