Change value of object

hi,

i’m using an object where i store some information i get form 4D, its called “o_loggedin” with the attribute “username” and “action”

is it possible to change only the action attribute? when i try this (see screenshot), the “username” attribute get lost. but i get an error when i enter something like this.

{“username”:o_loggedin.username,

“action”:“ubersicht”}

i’m using Qodly-Pro (with 4D)

Hello Manfred,

That’s an expected behavior since the standard edit action on objects replaces the entire object with a static value, rather than dynamically updating individual attributes.
If you need to modify only one property (like action), you can create a custom function that takes the new value as a parameter, updates the object internally, and returns the full updated object.

okay, so i need to create a class-function only for updating the value.

I know that its a desired feature to have the whole logic in 4d but sometimes i wish that there is a way to do it in the browser.

Actually, you can update a specific attribute directly by targeting it explicitly and setting its new value below. This way, only the specified property will be updated, and the rest of the object will remain unchanged.

Make sure to select the type “String” for the value you want to set below.

image

:face_with_peeking_eye: Yeah, of course, I was overcomplicating it.