I think the best way would be to set a variable in your code that handles the UI Message. In the picture below, I set a random number to StationGlobals.DemoNumber. You could do this with a string.

Just as a note, I try to avoid having the UI sending information to TestStand. It is much more reliable to have TestStand handle this so that you don't have to account for different code executing if you're in the UI or in the TestStand environment.
Pulido Technologies LLC