I am using a toggle component to turn the 'like' state of the page on and off. I have added a 'value change' event to this toggle so that it can invoke a datasource to save the new state as it is turned on and off. My database column is a string. So "on" / "off".
I would like to have the latest state of this toggle (on/off) auto-populated on the page load.
Problem: I have mapped the result of the service response (on/off) directly to the page ui. This results in the page load setting the toggle correctly, but this in turn fires the 'value changed' event setup to save the users last like. This saves the toggle state again the the database.
I have also tried to set a datasource - storage variable and then use the set property on page load, but this approach does not toggle the control on even if the storage variable is now "on" from the successful database call.
How do I setup a read from database - page ui without triggering the 'value changed' event?