question

abhishek6555 avatar image
0 Votes"
abhishek6555 asked PRADEEPCHEEKATLA-MSFT commented

pass variable in drop down from another notebook

Hi,

I am trying to pass a variable from notebook A to Notebook B which has drop down widget list.
However getting below error.

error message : select sequence must include X

Notebook A has below variable defined.
parameters_global['Source'] = '["X","Y","Z"]'

Notebook B has below code :


$run ./Parameter/notebook_A

dbutils.widgets.dropdown("Source","X",parameters_global['Source'],"Select Source")

azure-databricks
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PRADEEPCHEEKATLA-MSFT avatar image
0 Votes"
PRADEEPCHEEKATLA-MSFT answered PRADEEPCHEEKATLA-MSFT commented

Hello @abhishek6555,


If you run a notebook that contains widgets, the specified notebook is run with the widget’s default values. You can also pass in values to widgets.

For example: %run /path/to/notebook $X="10" $Y="1"

Note: This example runs the specified notebook and passes 10 into widget X and 1 into widget Y.

For more details, refer How to use widgets with %run.

Hope this helps. Do let us know if you any further queries.


Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @abhishek6555,

Just checking in to see if the above answer helped. If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

0 Votes 0 ·

Hello @abhishek6555,

Following up to see if the above suggestion was helpful. And, if you have any further query do let us know.
Take care & stay safe!

0 Votes 0 ·