Assistance with database trigger event to save a users address to a datatype later in app

In my project, users can find or give shapes. When they decide to click find, they become saved as a finder, when they decide to click give, they become saved as a giver. I would like it so that when they click either find or give, the address that they input on signup gets saved to the datatype they now become based on what they clicked (find or give) Now I know this involves a database trigger event, but this is my first time working in the backend and I am not sure how exactly to set it up. Here is a video I created to show what I need help understanding!

@keith… I’d bet my house that your amazing response was meant to go in this thread. Safest bet I’ve ever made. :slight_smile:

As for your question, @kryptoluna1234… it looks to me like you are making things harder than they need to be. Why not save the user’s address in the User data type when they sign up? A finder/giver is going to be linked to a user by the built-in Created by field in the Finder/Giver data type, so you will have access to a user’s address if you save it in the User data type. If you really want the address to be saved in the Finder/Giver data type, you could still save it in the User data type when the user signs up, and then you could copy it into the Finder/Giver data type when a user becomes a finder/giver.

Anyway, if I understand your video correctly, using a database trigger seems like overkill here when there is a much more direct way to go.

Hope this helps.


1 Like

Ha, thanks, @mikeloc. (Discourse, how does it work?)

1 Like

Hey @mikeloc

I have been working on this, and still running into some problems. Would you be able to explain how when a user clicks find or give, I can copy the current user’s address and place it in the finder or giver datatype?

But I do agree this is a much more direct way.