Get Table Object (without Dynamic List Behavior)

Way back when I was doing the CRUD Mission, to Retrieve an Object, I was trying to do it with Codeless. But ended up hobbling together a REST statement. That did the job. Now I’m back at the same problem I never solved. For now, I’m just trying to grab any record, but I get this Error Message:
image
I’ve tried quite a few variations and searched the Codeless Docs and this forum for a Codeless solution. (Just when I thought I was getting good at this.)

I want to use the Load Table Objects block, because I’m going to be using a where clause.

Let’s review what you have going on here:

  1. Retrieve a collection of objects from a table called Person
  2. The collection from (1) will become the value for a property called “name” in a new object you create
  3. Print out the object created in (2)

I do not think that’s what you wanted to do.

Can you change the steps above to reflect what you needed and we will guide you based on that.

Regards,
Mark

This example gets the 2nd occurrence in a list of 4. No errors now, but still don’t have enough items in the list to add a where clause.

Am I on the right track? Anything coming from the database is always a list. Tried a LOT of List blocks. Though the Filter might be a good way to get all. No.


Also, there’s a possibility that the Show Alert box can only show one line of text.

Can you share the link to the page?

Use the Get Joe button. That’s the one that works.

Ok, what is the difference in the implementations between the working and non-working buttons?

Both the non-working buttons use “Filter Items in list” instead of the “in List” block.

that’s a different operation… :slight_smile: Attach a screenshot and I will walk through it with you.

image

Got it, so here you get a collection of items and put them through the Filter items in list. Since the filtering block does nothing (there is no logic inside of the block) and it returns nothing, then the Get property "name" of block gets no data and it explains the “undefined” result in the popup.

Still working on it… Was I correct in my assertion?

Anything coming from the database is always a list.

Anything coming back from the Load Table objects block is always a list. If you get first/last or object by id, it would be a single object though.

(there is no logic inside of the block) and it returns nothing,

Added some logic to the “Filter Items in List” block. Still getting a “undefined” result.
image
Looking at the How to create a Codeless API Event Handler with data filtering logic video from back in June, I see the “Filter Items in List” wasn’t even used. Also, no reference to the “Filter Items in List” block in the Codeless Development Guide. (Must be a new block.) Also ran through the 108 posts is the Codeless forum section. And I always check the Backendless Videos youTube.

I’ll keep trying.

Inside of the filter block (where you return true now) you need to add logic to decide if Item is a candidate for inclusion into the result. If it is, you can “massage” that object or create another object which has to be returned in the “return” connector of the actual filter block.