• Version of Directus
8.4.0 (Digital Ocean)
How to do automatic calculation to place a field.
Example: 3 fields:
A. Field: quantity.
B. Field: unit value.
C. Field: total value (A*B).

I don't know, how to do this method in interface or hook or other for field C?
@benhaynes this could be a good use case for that readonly interface idea we had before 🙂
@andgar2010 we're thinking of having a couple "read-only" interfaces that would be able to display information like this in a more 'presentation' way
@rijkvanzanten agree with you to set "read-only".
as a field sample: Product Total Amount "$ 200.000"
I'd love to be able to have a custom function interface that allows for SQL functions in select statements. So that we could run things like:
CONCAT(name, "-", age) Or MAX(col1, col2, col3) or multiplication like what @andgar2010 was talking about.
I love that idea! It's hard to bring vanilla SQL into App/API since everything has to go through our database abstraction layer (for vendor support)... and also for security reasons. Still, I'd love to figure out a good/safe way to handle this. In the meantime, you can always create a custom interface/endpoint/hook to handle this... that's what those extension modules are for! 😉
@rijkvanzanten — yeah! I think we could look into a good way to have a readonly "metric" interface that also has some interface options for these common operators (eg: concat could be done with a template string).
Most helpful comment
I'd love to be able to have a custom function interface that allows for SQL functions in select statements. So that we could run things like:
CONCAT(name, "-", age)OrMAX(col1, col2, col3)or multiplication like what @andgar2010 was talking about.