Support Topics Documentation Slack YouTube Blog

Get user data before update business logic

(Ihor) #1

How can I get User data before update, I want to compare data in business logic
I call methods beforeUpdate and afterUpdate, both return new value


(Anton Govorushkin) #2

Hi Ihor

I’m not sure that I understood you correctly. Could you please provide some additional info:

  1. What is the final goal? You are updating property A in the Users table, and you want to get the old value of A property (before it was updated) and then to get the updated value of the same property?
  2. How do you call beforeUpdate and afterUpdate methods?

Regards Anton

(Ihor) #3

I want to get value before it was updated and after it was update and compare them.
I don’t call this methods, they call automatically, this is server side logic

(Anton Govorushkin) #4

Got it. I’ll try to reproduce the behavior you’ve described and respond back ASAP

Regards Anton

(Ihor) #5

Ok, thanks, i’m waiting for response, because it is very important for me

(Anton Govorushkin) #6

Are you using backendless 3 or 4?

(Ihor) #7

I am using backendless 3

(Anton Govorushkin) #8

Ok, I figured out how to implement what you need. If you will try to extract the old value from userValues in beforeUpdate you will be receiving the updated value.

If you need to get the old value - call


or extract the value of required property from current user if it’s logged in.

No changes required in afterUpdate code.

Regards Anton

(Ihor) #9