Hi Marija Kovrlija,
According to the documentation (Database plugin), it's recommended to execute the command only after the Database.ready event.
Even so, we recently experienced a scenario where the team believed the variable was being populated, but in reality the value was being sent empty; when this happens, the attribute is not recorded in the participant data.
Adding a console log on the client side can help identify this behavior.
I hope this helps.
------------------------------
Luiz Rosa
Full stack developer
------------------------------