CREATED WIDGET - SQL syntax - how do I specify a label?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 03:04 PM
What is the syntax in SQL for creating a widget in a notebook with a label?
This documentation says "The last argument is label, an optional value for the label shown over the widget text box or dropdown."
The one example provided on that page doesn't use a label for the widget. Here are my attempts:
CREATE WIDGET TEXT some_variable DEFAULT 'a great default' --succeeds, but no label
CREATE WIDGET TEXT some_variable DEFAULT 'a great default' 'some label/description' --syntax error
CREATE WIDGET TEXT some_variable DEFAULT 'a great default' LABEL 'some label/description' --syntax error
Labels:
- Labels:
-
Spark
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 05:32 PM
Hi @eriodega
I do not know how it works with sql but a possibility is to use a python cell in your SQL notebook and create it like this:
%python
dbutils.widgets.text("some_name", "a great default", "some label/description")
All the best

