Javascript variable

I have a simple Leaflet draw enabled map in an HTML block. On drawing a polygon my code will display json in:

  1. Console.log
  2. An alert box
  3. A downloaded text file.

However, I cannot capture to Bubble any of the variables that are available. I have tried Toolbox’s BubbletoJavascript and other methods including adding bubble_fn to the code block, but haven’t got any hair left to tear out.

Am I missing something? Please help me out!

code snippet