New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a formula field #3131
Comments
Yes, yes and yes! I've added it to the public roadmap, it could be awesome to have this new type of field available. https://portal.productboard.com/strapi/c/58-formula-field Please upvote the card and give me your insights, I close the issue. |
For that, you will need a little language with formula editor and a list of function. You can take look to salesforce editor here: |
Directus uses some kind of "in-field templating" e.g. for the content of a dropdown like: |
Could/Should I write an RFC for this ? Main Tradeoff seems to be about performance and genericity If going on with row by row evaluation : The other option is to parse the whole formula and try to translate it as much as possible to orm/strapi query language, at least retrieving all the used values a once. In any case, this repo can be a great inspiration for the jison lexer/parser Another trade-off is the level of complexity of the allowed excel like code, Some point other point of attention:
Maybe I have some time to wirte it in february. |
@dufoli please do feel free to write an RFC :) I'm not sure when we will be able to look at it as our "book" is quite full utnil after Q3 |
It is quite a standard feature on many CRM (saleforce, neolane,...).
It can be very flexible and useful for many things.
A formula field store a formula on metadata but nothing is stored in DB.
The formula is based on record fields and is calculated on the fly when api query this field.
potential use case:
with function:
-DaysAgo(myDate)
-If(IsClosed;'Closed', 'Open')
or just operations:
The text was updated successfully, but these errors were encountered: