User table unique key

Hey Gang, I’m working on a “two-sided marketplace” app where users can list projects and then apply to them. I’m using the new “switch” component in the marketplace! It’s similar to the checkbox component except it’s more style-able. These two components seem to be the only way to currently support this sort of use case where a user is submitting themselves/joining a listing created by another user.

One of the other needs of this app is to hide the switch/checkbox when the user is looking at a record/project that they created. In the case where the user is looking at their own record, they should have a button to jump to a list view where they can see all the applicants to their project. I’m able to toggle this “sometimes visible” settings on the two controls by using “Current Project > User > Email” is not equal to “Logged In User > Email” but just one problem: a user can change their email address whenever they want. It seems like a better reference would be to use that logged-in-user’s unique ID. Surely, Adalo creates a unique ID for this DB record, but it’s not accessible currently. Are there plans to add this property? Are there other ways of solving this? I added an “ID” field to the user table and at sign up time, I’m assigning it the value of the count of users in the system, but that seems fragile if two users end up signing up at the same time.

Ok so there are 2 things going on here it seems. The first is that perhaps there is a use case for the fact that when an email address is saved to another property (as text value) there should be an option to “always update” this value to the current live value within the DB. If this is done via a relationship then this should always be the live value.

So what you can do is instead of setting the rule based on a users email you could add a relationship to that project to the user itself and then base the rule on Current Project > User is not equal to Logged In User.

As for the ID, this is a feature request that can be found here: https://ideas.adalo.com/feature-requests/p/expose-record-id-for-filtersvisibility

By adding your vote to this feature request you accomplish 2 things; You let us know this is more in need and also you will be notified by email when this feature is available :slight_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.