How to make a "save" button a conditional also related to the user profile ?

Project Settings

Hello,

I have a page in my project where users can enter their information, with a "Save" button at the bottom.

What I want to achieve seems simple, but I haven't been able to get it to work for a week…

When the user (logged in via authentication) clicks the "Save" button, the action should:

  • Create a new document in the "employee" collection (which I created in Firebase) if it is the first time the user fills in their information
    or

  • Update the existing document in the "employee" collection if the user modifies their information.

Of course, these actions must be unique to each authenticated user. I'm not sure if I have set this up correctly in parameters, and I don't fully understand the logic behind it.

Could you help me and explain how these actions should work?

Thank you very much!

What have you tried so far?

I've tried, simple conditions, if, then, but I can't relate the proper values as I do not get the logic, and even less to refer everything to the user ID

Did you check FlutterFlow's Documentation for this topic?
Yes
1
1 reply