If I understand the question, you want to update a record in firebase with a value you have as a page variable?
If yes, then you have to delete the FB record and create a new one, using your new value, using the RestAPI. I´m doing this in my application. As far as I´m aware you can´t update a single field in a FB record.
i want to create record (not update). the firestore image above is only to see db-schema. i’m not using restapi - i use data resources firebase/firestore. therefore i have a data variable (addSubCategory), type new data record:
subcategory name: bound to data variable (addSubCategory) to create a single record (works)
categoryID: bound to page variable to catch the value, but cannot bind it to the create record flow *
i guess this needs to be somehow combined with formula, but no idea how ?!
it is all about this tiny part here, because i want the categoryID to be stored in the db without typing it, as this value is available in the page variable.
by the way: with data resources firebase/firestore it is possible to update single fields in a fb record.
Have you tried binding it as a formula, and then just selecting the same page variable? You might get a warning error but just ignore it.
When I tried updating a FB record some months ago it didn´t work and there were some forum comments stating just to delete / recreate. I guess this has been resolved now. What I´m doing works ok for me, maybe I will retry the change record at some stage.
Hi there, just trying to help out. For the brief solution skip to the bold text.
I would suggest using a addSubCategory page variable and bind the input field of the name to that page variable’s .name property.
Why so? If I get it right from the images, on page load you initialise a new data record addSubCategory which is an object with a few properties, one is “name”. I am not sure how the app would update the data.addSubCategory variable on input change, but what I know for sure is that it would update a pageVars.addSubCategory basically realtime. This makes it easier to catch and check if the subcategory is populated with the right data.
If you have a pageVars.addSubCategory on the button tap you could do the following:
Create Record and then in the Record Select binding type screen choose “Object with properties”.
Here you can set each of the data resources properties (that you defined under the data menu during configuration of the resource) individually. Something similar, just the title would be "Create record"
*Honestly, for simplicity reasons and cleanliness I usually have a page variable in which I set all the properties to what I want prior to “Create record” and then pass on the single created, evaluated and ready pagevar to the “Create record” flow function. As shown here as well: