How to pre-fill a column depending on the view

Good day everyone,

I hope you can help me. I have a table TRANSACTIONS and I want to identify easily the “INCOMES” and the “EXPENSES”, so I have a column [transactionType] which is an enum with those two values.

Then, I want to add 2 buttons “Add Income” and “Add Expense” which both use the same table.

I was wondering if there is a way to pre-fill the value of [transactionType] based on the the pressed button, so if someone presses “Add Income”, then [transactionType]=“INCOME”, and if someone presses “Add Expense” then [transactionType]=“EXPENSE”.

Is it there a way to achieve this?

Solved Solved
0 5 243
1 ACCEPTED SOLUTION

Thank you for all the details.

Presuming you mean primary views by the above and “Add Income” and “Add Expense” are two form type views, please explore having an expression like following in the initial value of [transactionType] . You could also keep this [transactionType] column hidden.

IFS(CONTEXT(“View”)=“Add Income” , “INCOME” , CONTEXT(“View”)=“Add Expense” , “EXPENSE”)

View solution in original post

5 REPLIES 5
Top Labels in this Space