Flask application --> Capturing the value entered via web form and passing it as a parameter to trigger a databricks job.
Tried passing the parameters as follows :
1- payload = {
> 'notebook_params': {
> 'customer_name': customer_name
> }
2- payload = {
> "notebook_task": {
> "notebook_path": "/Shared/.../",
> "base_parameters": {
> "customer_name": customer_name,
> }
> }
> }
While creating the job, passed the default parameter but this does not gets overridden, if I removed it than could see blank value is getting passed. enter image description here
In Databricks Notebook, the print command returns blank if no default value is set.
# Get the customer_name value from the parameter
dbutils.widgets.get("customer_name", "","")
customer_name = dbutils.widgets.get("customer_name")
# Use the customer_name in your notebook logic
print("Customer Name:", customer_name)
Could see the following Run parameters are used to execute the job enter image description here
I need assistance to identify if I am doing anything wrong and how I can overcome the issue.
# Get the customer_name value from the parameter
dbutils.widgets.get("customer_name", "", "")
customer_name = dbutils.widgets.get("customer_name")
# Use the customer_name in your notebook logic
print("Customer Name:", customer_name)
The above should return the customer_name= Cx4 that was passed as parameter when the job run was created via api call from the flask app.