How to add updating variables in Lanel text?

Is there a best practice on how to add regulary changing variables to labels in a way so they update while the screen is shown? For example sensor data? I was able to add float sensor data with the set_text_fmt but it doesn’t update. Also, is there a way to do the same for strings or a other way to transport changing texts of different length?

Squareline is Frontend generator, backend code is your job. Try show what you do and maybe forum helps. For example one way for update is in setup create and manage Timers — LVGL documentation

h2bs your code is nonsense

Maybe you know what type is second parameter here and what in your “working!” code … blabla

I am sure , that your first post here is disaster code. And my reply to @haller is perfectly relevant. When he ask or show code with trouble i help…
Your second code with delay 500 is next disaster…

If you want to watch the change of a string or variable and set a label automatically you need to do it periodically (‘observe’ in main loop or with timer as Marian_M suggests.)
A similar question has been asked in this topic: How do you send ESP32/Arduino variable to Squareline's GUI? - #5 by Marian_M