The points 1 & 2 are same as like you in my project.
But the third point, there is different than yours…Let me elaborate.
In my case, when an user register(sign-up) on my app, he needs to provide a Name+email id + Password and hit enter to register. Am using Firebase Rest API HTTP request to register user here. You can see Sign-Up HTTP flow function on the screenshots above.
I connected the next flow function Get current user to the signup flow then assign the output of get current user to a appVars UID with value uid from the output. Then your part comes… HTTP request with PATCH… to create record on my firebase DB.
Yes you’re on the right path, what need is to be able to create any record n firestore using http request… If can manage that, then you can add custom keys to the request and the body.just do a simple record to send. That way you’ll know where the problem is. Also make a toast that shows response code or message.
I think you understand wrong(because of my poor explanations). I didn’t create record using HTTP request, I said that I can create request by using “Create Record” flow function by adding Data Variable, but in this case document ID of my record is generated automatically by firestore itself @F_ORTELL
I am just telling you that I am able create record using create record flow function that create record using auto document ID…
But the HTTP request with PATCH method from your instruction wont work in my App, that’s what I am saying to you. If it works, then only I can create document in firebase with Document ID as UID like you said. @F_ORTELL
Maybe there’s something wrong with the code I sent,but I can’t test it coz I left my pc. However, you use http request to send data with custom id… Look for other posts talking about setting custom id in the forum, um sure you can find something.
I did it @F_ORTELL Thank you very much for your support, really appreciate that.
The problem is with my appVars, use toast on all the node to track the flow. Then I realize that they stop at appVar that I has set before HTTP request. Digging on that I got the solution and fixed the issue.
Now I can create or update record using PATCH method with custom ID. Thanks again.
Hi F_ortell, I used the url as your suggested and used patch for my Http request. When I login, it creates a new record in firestore instead of updating the existing record. Does it meant to update the existing record by replacing the auto id generated with the user id?
I don’t quite understand your last reply, could you please explain a little further?
I get the firebase id from the Email & password authentication flow function and set it as an app variable, then I use the url you provided to try to update (patch method) the current auto generated document id with the user id. In my document, I only have the email and password fields under the user.