The most important concept to keep in mind is that every workflow run is completely independent from all other workflow runs. The trigger that started the workflow creates an entirely new payload on each execution. The payload that the trigger creates depends on the specific trigger.
From your screenshot, you appear to be reporting an email address via device state, which is causing the Device: State Trigger to run this workflow with whatever value was reported by the device (i.e.
You then also have a Virtual Button Trigger being invoked with a different email address (i.e.
These two triggers and the payloads they create are independent from one another. Invoking the Virtual Button has no affect on the data being reported by the device, which is why you don’t see any behavior change.
There are a couple of options based on how you intend for your application to work:
- When the Virtual Button is pressed, send a Device Command to the device to change the value it’s reporting.
- When the Virtual Button is pressed, save the new email address to Workflow Storage. When the device then reports state, get the email from storage.