Displaying API response neatly using repeaters/data binding

Hello Backendless support,

I’m having trouble neatly displaying my API response (which returns in json format) in a neat way in my backendless application. I have looked over the Repeaters section in the UI builder dev guide, and they usually bind an object property to a text content logic. In my case I’m not sure if this is possible, but I have been told to use repeaters in order to try and structure the outputs tabularly. I have detailed my approach below through images.

Thank you for the help,
David Zhai

Here is the current formatting of the API response which I want to clean up:

Here is the logic for my getDriverAvailability button:
image

Here is the logic for the text component in the block:
image

Hello @David_Zhai

This works as it should. You have cloned text blocks for each available driver. The blocks just don’t have styles and don’t stand out against the white background.

What exactly did you encounter that you didn’t expect?

Regards

Hey Viktor,

So we were trying to neatly display specific properties of the JSON response. We have it looking neater now, for instance:


My confusion was that the documentation on repeaters had examples of populating a list with objects, but these objects had hardcoded properties such as name. I was obtaining data dynamically (a JSON response from an API), and wanted to display certain properties. To get it working, those properties needed to be accessible. Here was my approach:

I was then able to create text components and set the content logic to be for instance driverName (which in standard code would have been driverStatus.driverName).

Hello @David_Zhai,

I just wanted to make sure everything is going smoothly and that you’ve been able to implement what you had planned. However, I’m a bit unclear on what you meant when you said:

My confusion was that the documentation on repeaters had examples of populating a list with objects, but these objects had hardcoded properties such as name.

Additionally, when you used the first approach, it seems you also had the ability to access the object’s properties, just as in the second approach. If this wasn’t the case, could you please clarify what specific issue you encountered?

Regards,
Alexander

Hello Alex,

I think you are correct and I should have been able to access the properties on the first approach as well.

Thank you,
David