Support Topics Documentation Slack YouTube Blog

Updating a Property of an existing object inside the Users table in Backendless


(Jason Brown) #1

I am trying to update an Object inside my Users table using the code posted below. Every time I Deploy/Invoke it says OK but the Object in my database is still unupdated


(Vladimir Upirov) #2

it does’t work because you use “Find use by identity” block three times and every time it returns a new object

the solution is:

  1. call “find user by identity” only once and set it into variable
  2. modify the variable
  3. save the varable

(Jason Brown) #3

Hello Vladimir,

I Changed it like you said, it works!! but it keeps only generating on the first object in the table. Even if I send through a different email parameter when I Invoke it. Any tips? My code is below.

image


(Vladimir Upirov) #4

do you mean the “find user by identity” block returns you a wrong user?
Could you add a “Text -> print” block and set your “theUser” variable to check it in logs?


(Jason Brown) #5

Yeah, I keep only getting the first object that is in my Users table. When I update theUser it saves the userCode to the first entry in the Users table. Okay I will try that


(Jason Brown) #6

I don’t know how to check the logs :<


(Vladimir Upirov) #7


(Jason Brown) #8

Thanks Champion. I checked the log. Seems to me that the variable just stays the same no matter what parameter I send through.


(Vladimir Upirov) #9

could you please provide your appID


(Jason Brown) #10

8D258B32-0B9A-8BD8-FFB8-F35B51E11B00


(Vladimir Upirov) #11

I’ve found it, the problem is with the “find by identity” block, will fix that asap, but now as workaround you can use “Load table object” block and get the first element


(Jason Brown) #12

Thank you so much Vladimir! I just want to confirm the “find by identity” block not working is a Codeless problem and not caused by a mistake I made?


(Vladimir Upirov) #13

yeas, the problem is in Codeless code generation


(Vladimir Upirov) #14

btw, the issue has been fixed, we’ll release the changes as soon as possible


(Jason Brown) #15

Thank you Vladimir, would you be so kind as to let me know when the fix was applied?


(Vladimir Upirov) #16

yes, sure, we will notify you here when the fix is released
internal ticket id is BKNDLSS-17518