...
- In Canvas Studio, click Connections on the left pane.
The existing connections are listed in the Connections and Data Sources on the right pane. - Right-click the connection and select Create Data Source.
The Create New Data Source page appears. In the Create Data Source page, enter an unique data source name in the Data Source Name field.Enter the table
Click the Object Name field and select the object name from which you want need to fetch the data in the Table Names field. You can enter multiple table names separating each table name with a comma (see second code snippet in Step 7).
Enter either * (asterisk) or column names separated by comma in the Column IDs field.Tip Alternatively, you can specify view name instead of the table name in the Table Names field. For example, if suppose you have created a database view as follows:
Code Block language sql create view Products_Above_Average_Price as select Product_Name, Unit, Price from Products where Price > (select avg(Price) from Products);
In the SQL code snippet, Products_Above_Average_Price is the view name, which you can enter in the Tables Names field.
- Click the Column IDs field and select the columns to be fetched.
- Optional: Enter the column names by which you want to sort the data in ascending or descending order in the Order By field.
Optional: Enter the condition for filtering the data in the Where Clause field. For example, in the SQL code snippet mentioned in step 4, the where condition Price > (select avg(Price) from Products) can be given in the Where Clause field.
Info If suppose, you want to fetch data based on certain values, you will have to specify the exact values in the Where Clause field. For example, consider the following SQL query:
Code Block language sql select * from Products where Product_ID = 'P001'
Here, Product_ID = 'P001' can be given in the Where Clause field.
Consider another example as follows:
Code Block language sql select Product_Name, Unit, Price from Products, Categories where Products.Category_ID = Categories.Category_ID and Categories.Category_ID = 'C001'
Here, Products.Category_ID = Categories.Category_IDÂ and Categories.Category_ID = 'C001' is the where condition, which can be specified in the Where Clause field. The tables Products, Categories can be specified in the Table Names field.
- Click Save.
The following confirmation message appears: