raghu2
Databricks Partner

The parameters are passed as widgets to the job. After defining the parameters in the job definition, With following code I was able to access the data associated with the parameter:

widget_names = ["loc1", "loc2", "loc3"]  # Add all expected parameter names here

print("Parameters passed to the notebook:")
for name in widget_names:
    try:
        value = dbutils.widgets.get(name)
        print(f"{name}: {value}")
    except Exception as e:
        print(f"{name}: Not defined (Error: {str(e)})")