Name of button that launched snippet

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Is it possible to grab the DOM Id of the button in a page title that was clicked to run the snippet?

I can find the Id of the page title that the button was in by going to:

arguments[0].component._GUID

But is there anyway to find out which button from that page title was clicked? I see initiatorId, but that is not the same as the DOM Id I gave the button.
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Look at the Advanced Tab of the button properties.  There you can define the DOM Id.. 
Photo of Craig Rosenbaum

Craig Rosenbaum

  • 4,776 Points 4k badge 2x thumb
Hi Rob, I had defined the DOM Id for my buttons on the advanced tab and it still was showing me the random number id for the button in my script. However, this morning I tried again and it was working! The only change I made was upgrading to Rockaway from an older Banzai version, so maybe that's why. Either way it seems to be working now.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
If the pagetitle button is a 'run javascript' button (not a multiple actions, last time I checked) then the the snippet will get passed arguments[0].button, which has lots of goodies.