Support Topics Documentation Slack YouTube Blog

Crud rookie mission help

Mission: CRUD ROOKIE
Task: Add Object With API

give some idea in doing this mission how to do it

It can be done with REST, Android, iOS, JS, Flutter, .NET. Do you have a preference for one?

I’m having problems as well. I prefer JS (as I know it) but I don’t have a client-side environment (that I know of). I thought we would be able to do all this inside BackEndLess but now I need a separate environment?

This can be done in a web page, in a node service, in a page created with UI builder. Plenty of possibilities.
Have you looked into the Backendless API docs? They include information about environment setup as well as the actual api for saving an object in the database.

Regards,
Mark

I tried creating a web page with the code provided (and correct keys) and it did nothing. The database didn’t update. Here’s the page code:

JavaScript Test


Click me to display Date and Time.

Looks like you haven’t imported Backendless sdk. See the docs here:
https://backendless.com/docs/js/setup.html

So the Backendless.initApp( application-Id, api-key ) element is in the code. Since we’re doing this through a web-page, I thought that was all I needed to do. Is there an example of a full web page code that would work (if I just enter my API codes)?

Backendless.initApp and all Backendless classes, methods, etc need to come from somewhere, right? They are not built into the browser. In order for them to be recognized by JS, you need to import our library using the <script> tag.

Apologies for being a neophyte. Do you have a reference for a web-page script that actually works (maybe just have to copy in my APP ID and API settings?

I have backendless referenced in the tag using the non-compressed library. The page is at https://backendlessappcontent.com/30D98CE4-A447-1DAB-FF9D-F066D356E700/7F5C9ECF-A868-4E60-961B-DEFE8189340A/files/mission/task.html. Still doesn’t add the data to the file though it got rid of a couple errors in the page.

The Backendless SDK should be imported with a separate script tag. Then in another <script> tag you put your code. I made the changes in your html file. Now when it runs, there is a message in browser console saying the object has been saved:

Thank you. Yes. That works.