Appgyver + Backendless Updating Record on Page

Hi,

I could successfully Create Record of email, password, username, birthdate (On RUN TEST @ Data config, web)

But moving on to Update Record within the web (RUN TEST @ Data Config), there’s a prob.

Resource URLs are the same: https://apibackendless.com/APIcodes/users/register
For relative path and response key path at Create Record tab, I left them empty.

For the relative path and response key path at Update Record tab, I put them as /{objectId} and objectId respectively.

For both cases, HTTP headers are the same with Content-Type and application/json.
URL Placeholders and Query Parameters are left empty.

My hypothesis is Creating a record on the registration page with email and password, and subsequent updates will be Updating Records.

Does anyone know how can I inform the system on subsequent pages that any updates will go back to the object (user) that registered on the registration page?

I know a dynamic URL to reflect the objectId changes between different users and the need to pass objectId along the pages as each user progresses will be needed.

:sob:

Your help is much appreciated!

Backendless doc states this in updating an object:

"

curl \
-H Content-Type:application/json \
-X PUT \
-d “{“name”:“Bob”, “age”:20 }” \
-v https://api.backendless.com/application-id/REST-api-key/data/Person/6C77C11B-E9B3-EB14-FFA2-69F38CF48800

"

Meaning to insert the exact objectId in the resource URL (as bolded above).

Created a new API DB to run this. Updating Record (username, birthdate) in the backend for the particular object is possible, but this is only because the exact objectId is given in resource URL.

First question: How do I write the resource URL/relative path such that the objectId can be recognised and passed on from ‘Create Record (Post)’ for each user without the objectId being inserted manually?

Second question: Is there a need to create a new API DB to run this? Or can I run the ‘Update Record (PUT)’ in the initial resource URL of https://apibackendless.com/APIcodes/users/register ?

Thanks for any help guys!!

Hi,

First question: you’ll have to add it as a url placeholder into your data resource configuration, so the url will be something like

https://api.backendless.com/application-id/REST-api-key/data/Person/{person_id}

Now everytime you use the Update Record flow function, the node will require you manually insert the updated object’s id as a property. So no, the id cannot be automatically recognized from the object, according to that documentation you’ll have to set it as a url placeholder and manually set the id.

Second question: I think you’ll have to create a new REST API Data resource for handling CRUD (= create, read, update, delete) operations on Persons. This is because the API urls do not have similar bases:
https://apibackendless.com/APIcodes/users/register
https://api.backendless.com/application-id/REST-api-key/

It is also kinda good practice to have the register and login functions as one resource, and then handling Person stuff in a separate resource :slight_smile:

Roger that @Cecilia , thank you!

1 Like