Read arguments in a scala note invoked by a job.

rrussell25
New Contributor

In a scala note, how to I read input arguments (e.g. those proved by a job that runs a scala notebook). In python, dbutils.notebook.entry_point.getCurrentBindings() works. How about for scala.

UmaMahesh1
Honored Contributor III

Hi @Robert Russell​ 

You can use dbutils.notebook.getContext.currentRunId in scala notebooks.

Other methods are also available like

dbutils.notebook.getContext.jobGroup

dbutils.notebook.getContext.rootRunId

dbutils.notebook.getContext.tags etc...

You can check out the list of methods available in getContext using the autofill feature 😅 by hitting tab after dbutils.notebook.getContext.

Cheers..

Uma Mahesh D