DQL Documentation
Hello Dojo Community, where can I find more documentation on the DQL stuff?
I want to know how to tell the code to get all records which a given column string is like '%TEXT%'
Thanks in advance.
Best Answer
-
Have you taken a look at this yet? https://developer.domo.com/docs/dataset-api-reference/dataset#Query%20a%20DataSet
You should be able to provide Domo a SQL statement to choose which records you get.
Example from that documentation:
POST https://api.domo.com/v1/datasets/query/execute/ce79d23f-ef7d-4318-9787-ebde54a8c5b4
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>
{"sql": "SELECT * FROM table"}Based on that I'd expect something like below to work.
{"sql": "SELECT * FROM table WHERE column1 like '%Text%'"}
Or do you mean something else entirely?
**Make sure to like any users posts that helped you and accept the ones who solved your issue.**1
Answers
-
Have you taken a look at this yet? https://developer.domo.com/docs/dataset-api-reference/dataset#Query%20a%20DataSet
You should be able to provide Domo a SQL statement to choose which records you get.
Example from that documentation:
POST https://api.domo.com/v1/datasets/query/execute/ce79d23f-ef7d-4318-9787-ebde54a8c5b4
Accept: application/json
Authorization: bearer <your-valid-oauth-access-token>
{"sql": "SELECT * FROM table"}Based on that I'd expect something like below to work.
{"sql": "SELECT * FROM table WHERE column1 like '%Text%'"}
Or do you mean something else entirely?
**Make sure to like any users posts that helped you and accept the ones who solved your issue.**1 -
Thanks. It can work.
I was expecting to recreate something like what was shown in the Advanced App Building course at DP19 with Cameron Williams:
var dql = {
columns: [
{
exprType: "COLUMN",
column: "PrimaryInspector"
},
{
exprType: "FUNCTION",
name: "SUM",
arguments: [{
exprType: "COLUMN",
column: "TotalTime"
}]
}
],
groupByColumns: [{
exprType: "COLUMN",
column: "PrimaryInspector"
}],
where: {
exprType: "EQUALS",
rightExpr: {
exprType: "COLUMN",
column: "SecondaryInspector"
},
leftExpr: {
exprType: "STRING_VALUE",
value: "NESTOR MEZA"
}
}
}
domo.post('/dql/v1/mwp', dql, { contentType: 'application/json' }).then((data) => {
var rows = [];
data.rows.forEach(row =>{
var obj = {};
data.columns.forEach((column,i) => {
obj[column] = row[i];
});
rows.push(obj);
})
console.table(data);
})But it's kindda fuzzy so I'll go with traditional SQL for now
0 -
Oh interestings, I feel like their developer documentation is a little lacking, I've read through quite a bit but never came across doing it that way, maybe the documentation exists but I haven't seen it.
**Make sure to like any users posts that helped you and accept the ones who solved your issue.**1 -
Hopefully some of the gurus sees this post and gives us a learning path on this topic.
Thanks anyways!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive