Rf receiver and blynk

Hij everybody
Im trying tot receiver a code, with rcswitch.
Problemen is that:

If(mySwitch.available()){
int value = mySwitch.getReceivedValue();

Only works within the void loop()
I would like tot see the code in a value block of the blynk app. Hoe do I do this. I already tried several things with the virtual prins etc.

Van anybody help me ???