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
- 10.5K All Categories
- 8 Connect
- 918 Connectors
- 250 Workbench
- 473 Transform
- 1.7K Magic ETL
- 69 SQL DataFlows
- 478 Datasets
- 208 Visualize
- 257 Beast Mode
- 2.1K Charting
- 12 Variables
- 18 Automate
- 355 APIs & Domo Developer
- 89 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 247 Distribute
- 63 Domo Everywhere
- 243 Scheduled Reports
- 21 Manage
- 42 Governance & Security
- 183 Product Ideas
- 1.2K Ideas Exchange
- 11 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive