Using owner Id to store data in account

You have logic that saves the current number in the database.

When the user revisits the page, you want to get the number they left off from the previous visit to the page.

To do that, you need to retrieve the number saved in the database when the user opens the page

That is done by making a query to the database and getting the number from the user’s record.

Once you have that number, you initialize a page data properly with it .

Ok Yes, I knew that. The problem is that I have tried to do that before and couldn’t find the block to that.

A block to do what specifically?

This

The following tutorials should help:

Ok heres what I’ve got:


This is in the buttons code

And this is On page Enter:
image

The problem is, when I run it, it gives me the output “Null”

Did you login?
Can you enable “reload” checkbox and retry?
What object you are updating? Did you debug(print values) or check in database if needed user were updated?

You’re making good progress, but there are a few problems with the logic you shared:

The following logic will save an incremented value, however the value in Page Data will remain the same - you need to add additional logic to increment the value stored in Page Data

In the following logic you will fetch 10 records from the Users table and store them all in the Points property in Page Data. This is not what you want… You need to retrieve a specific record from Users - the record that corresponds to the currently logged in user. Keep in mind that the Load Table objects block always returns a collection of objects (even if it is a collection of one). So you need to fetch one specific record/object add logic to extract that object from the collection. Then you need to get the Points property from that specific object:

Hmm…
I thought I fixed it it but it just wont even show a message now…


Please let me know my mistakes,

Tyler

I do not see any changes here:

Regarding the logic above, I described what should be done here:

This does not make sense:

The following comment was not addressed in your logic:

So does that mean I can’t use the Load table object block?

Also I don’t get what block I should use for this

No, you need to use that block, but you need to enhance the logic so it also does the following:

  1. Uses a where clause to load a record for the current user
  2. Extract the first object from the value returned by Load Table object
  3. Extract the Points value from the object returned by #2 in this list.

Regarding the following, I believe this should help: https://youtu.be/3mN4BTHt2WQ?si=Xswx6JkHbJ0-zMU5

Hi Mark,

I hope you’re doing well!

I wanted to reach out as part of the Pocket Perks development team regarding the page size settings for retrieving items from the “Users” table. It seems that when I set the page size to 10, it returns only 11 items, and I’d like to retrieve all entries. Here is the block:

Your help has been greatly appreciated, and I’m confident we’re on to something.

Best regards,
Tom
Pocket Perks Development Team

Hi Tom,

When you set it to 10, it should return up to 10. The maximum value supported in the Cloud version is 100; you can use paging to retrieve more. Here’s a doc on paging:

https://backendless.com/docs/js/data_data_paging.html

Regards,
Mark

@Tomdabom , also, please create a new topic for every new question. It will help keep the conversations on topic, and others can benefit from finding answers faster.

Thank you!

Hi Mark,

Thanks for the clarification! I appreciate the link to the documentation on paging. I’ll take a closer look at that to better understand how to retrieve all the items I need.

If I have any further questions, I’ll be sure to create a new topic as suggested.

Thanks again for your help!

Best,
Tom

1 Like

You are welcome!

Btw, here’s a how-to article describing how to use paging to load more than 100 objects:

Hi Mark,

I just wanted to say a big thank you for your help with updating the User table in Backendless. What we’re doing right now would not have been possible without your expertise and support!

Best regards,
Tom

You are most welcome. Glad I was able to provide some guidance.

Regards,
Mark

Hi Mark,
I Just wanted to say thank you,
I went on holiday and came back and the sultion jst clicked for me.
As for the real time database part, the app seems to be working fine without it.

Thanks so much,
Tyler :slight_smile: