Data Validation

Hi,

I am building an expense tracking app… The transaction database contains all, you guessed it, the transactions (both credit and debit). The key thing to note is this database contains transactions for all users. I do not want to allow users to add a debit transaction that would take the balance to negative. As there is no form validation and no way to group the database records by customer ID, I am kind of in a limbo. I am 90%. there to publish the app and this is becoming a showstopper.

Any advise on how to handle this?

Note: Hope Adalo puts the Series A $8MM funding into good use to enable most sought after features.

This is very much possible to do, you need to setup relationship between transactions and user collections (many to one), this will restrict users from seeing each other’s information/transactions.

Thank you Bhanu for the quick response. One problem I have is the admin logs in and creates/updates transactions for multiple users (More like an admin managing multiple employee expenses). Eventually employees will have their own app with only their view and what you suggested would work wonderfully for that.

Any help would be deeply appreciated.

When the admin performs action, you can provide additional step to select staff name that expense belongs to and update the table accordingly and an additional column to indicate who updated the record for audit purpose.

This is what I have so far.

Transactions table with four columns (few other columns for audit purposes but will not impact the functionality). I have the user column as there are multiple admins managing different departments and this is linked to the logged in user.

Employee_name, Amount, Type, User
Employee 1 $5000. Credit. Admin 1
Employee 1 $2000. Credit. Admin 1
Employee 2. $9000. Credit. Admin 1
Employee 1 $3000. Debit. Admin 1
Employee 1. $5000. Debit. Admin 1 - This transaction shouldn’t be allowed as the “Employee 1” balance will go negative.

I have two screens, one each for entering credit and debit.

What am I missing here?

I believe you’re updating this table and populating the user with the person doing the changes in App. In this case you need to split the flow between Admin & Actual user.

When admin performs action - the table should be updated with the first 3 fields and for the 4th field admin should have a dropdown with list of staff to select from and update the db with that user.

when the user performs action - the 4th field in the above step should be defaulted to the current user.

The employee doesn’t even hav a log in the current setup. There is only 1 user and that is “Admin 1”

Does the users have access to the app to see their information? If no, where do they see others data?

And coming to -ve data, you need to check first whether the balance becomes negative by using the conditional action before performing the action.

i.e. Do this only when the debit transaction amount is less than the available balance. This will stop from proceeding with action

I am building only admin app and the users (Employees) will have their own app. Not in scope for current project.

You are correct. I should check before adding the -ve data. I am just not sure how to go about it in Adalo.

When you’re performing the action, click on Show advanced at the bottom and choose “Sometimes” and then add your condition below in “This action will only happen if” …