It should be blkCountries Item Data. That’s the object that has the country object. There were some changes in the design after I recorded the video. The blkCountries in your case would be the entire collection, while blkCountries Item Data would be a single object (which is what you want).
Hi Mark
It was a very good tutorial, covering a really valuable topic.
Basically you created a dynamic block linked to Country with the Country name flowing down the page (as per my prior screen shot.
Inside the Country block you created a left-right block to contain all the Cities in a Country.
From your tutorial the final result is…
Here you will see the error the backend returns. By looking at the schema, the error makes perfect sense, there is indeed no Country column. The relation column connecting City and Country tables is called CountryCode:
In your tutorial you put Country.objectID. I took that to be Tablename.ColName.
But it seems I have ended up with Colname.Colname.
I am guessing that CountryCode worked by itself because its value is actually objectID to satisfy the relationship, would I be right?
Anyway, thanks Mark, I have moved onto the next tutorial now, Adding Data into the database, and the relationship is not working there either. I will use your debugging technique before I ask for help.
When you retrieve data from a table and use a where clause, the where clause references are always column names. In my video I must have renamed CountryCode column to Country. When it is a relation column, then it must followed by a column from the related table. Hence we get CountryCode.objectId.
This is just a suggestion rather than a problem. I did strike a problem with the Add Data to Database tutorial, but it was me, not the tutorial or backendless.
To get to my bug, I sprinkled Try Catches and Show Alerts around the main code blocks.
I love backendless and UI builder, but can the ShowAlert be made to look better. I realise that making text boxes visible and invisible can do the same job, but ShowAlert is better.
I would like at least, to replace the default title that you see here, with a title of my choice.
My understanding is the alert window we use is not stylable. See the discussion on SO here.
Rather than using the “Show Alert” block, I recommend using the “print” block. The block will output your logging messages to the browser’s developer console window. Here’s a great overview of DevTools console:
The difference between the approaches is huge - alert blocks the execution of your app and cannot be styled. Console does not block and you can see the log messages as the app runs.
Hi Mark
The popup ShowAlert would mainly be useful for displaying information to the user rather than debugging. Your technique in your tutorials is to create a text box in a coloured block, and which you control the visibility of. Without a ShowAlert, in which I can set my own title, I will continue this way.
Thanks for the advice.
Kind Regards
BruceX