7

I'm trying to create a multi-paragraph dashboard using a Zeppelin notebook. I'd like people using the dashboard to only have to enter certain parameters once. E.g. if I'm making a dashboard with information about different websites, the dashboard user only has to select the particular website they want information about once and the whole multi-paragraph dashboard will update. Is this possible? How do I set global variables like this in a notebook?

To clarify, the parameter input that I intend to use for Zeppelin is referred to as "dynamic form".

Danny David Leybzon
  • 670
  • 1
  • 9
  • 21
  • I'm not very sure what do you mean by global variable ? A variable is shared among notebooks in Zeppelin – eliasah Oct 28 '16 at 06:18
  • 1
    I think @eliasah means that a variable (e.g. : `${formName}`) is visible only within its paragraph and not across all the paragraphs of the notebook. What he means is "set once, use everywhere". – marius_neo Oct 28 '16 at 08:01
  • Couldn't have said it better myself @marius_neo – Danny David Leybzon Oct 31 '16 at 18:54

2 Answers2

4

Using z.put and z.get can share variable over different notebooks.

z.put("name", "zeppelin")
z.get("name")

Possibly combine with z.angularBind and z.angular to use it in dashboard. ref How to put a variable into z ZeppelinContext in javascript in Zeppelin?

Community
  • 1
  • 1
Rockie Yang
  • 4,725
  • 31
  • 34
2

You can use notebook-level global variables in the SQL by using the syntax $${variableName} instead of ${variableName}. [Reference].

When you run one of the paragraphs that uses global variables, the global variable input fields will appear above all the paragraphs.

Danny Varod
  • 17,324
  • 5
  • 69
  • 111