How can we add formulas in API

I basically use API to insert data into my database.

I am thinking is there any type of feature where we can determiners specific condition or formulas before the data is inserted into the database. For example if the post API function is pushing a list of data into db, if Order_day is Sunday then mark status as pending.

Also how to generate auto numbers (only even number)

Thanks :+1:


You can create a column named Status that has the type Formula. Enter the following formula: if(field('Order_by')='Sunday','Pending','In Progress')

Every time you insert a record, the formula column should be filled in automatically.

An Id is automatically generated every time you insert a record. You can get this Id with a formula function row_id(). So, if you add a new column of the type Formula and enter the following formula: row_id() * 2 it will generate an id that is always an even number.

However, I have the feeling that my solutions with formulas might be too limited for what you have in mind. In that case, I can recommend using N8N as an automation service. This allows you to modify and check your data before it is inserted into your base.


1 Like