Best Of
Re: Percent of Total on Table Chart
You can use SQL functions in Beastmode (not documented though).
Try this:
SUM('field name')/SUM(SUM('field name')) OVER ()
Re: ETL Formula to extract numeric ID at the end of campaign name
Glad you got it to work. Yes, using the SPLIT_PART function with it looking for the underscore character will return the ID you want.
Re: Dataset from Email upload
I'm not sure of the question.
A dataset in Domo is identifiable from its ID number. Open the dataset in Data and look at the URL. There will be a number there. That's the unique id for the dataset. Programmatically could access that data and pass it over to Oracle.
For Domo "token" information look for the pages on developer.Domo.com to create a client id with secret key.
Accessing depends upon the method/language. Javascript, Python? Something like this in Javascript:
const axios = require('axios');
// Domo API credentials
const clientId = 'your_client_id';
const clientSecret = 'your_client_secret';
// Base URL for Domo API
const baseURL = 'https://api.domo.com';
// Function to authenticate and get access token
async function authenticateAndGetToken() {
try {
const response = await axios.post(${baseURL}/oauth/token, {
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
});
return response.data.access_token;
} catch (error) {
console.error('Error authenticating with Domo API:', error);
throw error;
}
}
// Call the function to authenticate and get token
authenticateAndGetToken()
.then(token => {
console.log('Access token:', token);
// Proceed to next steps (retrieve dataset and export)
})
.catch(err => console.error('Error getting access token:', err));
And export it in javascript with something like this:
// Function to export dataset data
async function exportDataset(datasetId, accessToken, format) {
try {
const response = await axios.get(${baseURL}/v1/datasets/${datasetId}/data?format=${format}, {
headers: {
Authorization: Bearer ${accessToken}
}
});
return response.data;
} catch (error) {
console.error('Error exporting dataset:', error);
throw error;
}
} // Usage example: Replace your_dataset_id with the actual dataset ID
const datasetId = 'your_dataset_id';
const exportFormat = 'csv'; // or 'json' // Call the function to export dataset data
authenticateAndGetToken()
.then(token => {
return exportDataset(datasetId, token, exportFormat);
})
.then(data => {
console.log('Exported dataset:', data);
// Process or save the exported data as needed
})
.catch(err => console.error('Error exporting dataset:', err));
Using Python:
import requests Domo API credentials client_id = 'your_client_id'
client_secret = 'your_client_secret' Base URL for Domo API base_url = 'https://api.domo.com' Function to authenticate and get access token def authenticate_and_get_token():
url = f'{base_url}/oauth/token'
headers = {
'Content-Type': 'application/json'
}
data = {
'grant_type': 'client_credentials',
'client_id': client_id,
'client_secret': client_secret
}
response = requests.post(url, headers=headers, json=data)
response_data = response.json()
return response_data['access_token'] Get access token access_token = authenticate_and_get_token()
print('Access token:', access_token)
Retrieve details:
Function to retrieve dataset details def get_dataset_details(dataset_id, access_token):
url = f'{base_url}/v1/datasets/{dataset_id}'
headers = {
'Authorization': f'Bearer {access_token}'
}
response = requests.get(url, headers=headers)
return response.json() Example usage: Replace your_dataset_id with the actual dataset ID dataset_id = 'your_dataset_id'
dataset_details = get_dataset_details(dataset_id, access_token)
print('Dataset details:', dataset_details)
Export for import in Oracle:
Function to export dataset data def export_dataset(dataset_id, access_token, format='csv'):
url = f'{base_url}/v1/datasets/{dataset_id}/data?format={format}'
headers = {
'Authorization': f'Bearer {access_token}'
}
response = requests.get(url, headers=headers)
return response.json() Example usage: Replace your_dataset_id with the actual dataset ID exported_data = export_dataset(dataset_id, access_token)
print('Exported dataset:', exported_data) Example of exporting to CSV file (optional) import csv csv_file = 'exported_data.csv'
with open(csv_file, 'w', newline='') as f:
writer = csv.writer(f)
for row in exported_data['rows']:
writer.writerow(row) print(f'Exported data saved to {csv_file}')
Re: ETL Formula to extract numeric ID at the end of campaign name
Are you referencing the correct field in your formula tile? Neither of these two samples contain the word Expense so there is no way the preview could display Expense in the result of the RIGHT function usage. I would double check that you are referencing the correct field in the formulas.
Based on these two samples, both of my suggested functions should return the numeric id you are looking to extract.
New On-Demand App Studio Course Available
Domo University has just launched a new on-demand training course for Domo App Studio covering the following aspects of this powerful feature:
App Studio Strategy and Value
Apps Home
Creating a New App
Importing Dashboards
Adjusting Page settings
Tabs
Page Drilling
Persistent Filters (beta)
Buttons and Forms
App Navigation
Themes, Styles, and Colors
Styling Tables
Fonts
Apps on Domo Mobile
Embedding App Studio apps
Apps Administration
You can access the course from Domo University, here.
zcameron
Re: Form Viewer
@Jessica I recently struggled with this as well. I wish the implementation and documentation of Form Builder/Viewer was stronger. Hopefully my instructions will help you.
The first thing that you will want to do is to go to your Form Builder where you built a form and select Edit Card in the wrench. Then, click on the Collections container and copy the datasource id in the data preview box.
You will use this datasource id to help you link the form viewer properly.
Now go to your Form Viewer and select Edit Card in the wrench.
You are now going to need to map each dataset that is listed in the dropdown list
Start with the first one and then click on the dataset listed below Select Dataset. Enter your datasourceid in the serachbox and then select the one that matches the name. (In the above example look for ExportPreviousResponseItems_datasourceid). Click Choose Dataset.
Do this for each of the items listed in the dropdown list and then save the card. You should see your forms listed in the form viewer now.
It is a best practice to then leave this card as your form viewer template and choose Save As before clicking on a Form and linking the form viewer to the appropriate form. This way, you don't have to go through that process every time you create a new form.
Hopefully this works for you.
Re: Starting Major Domo Certification - Tips for Success?
The Major Domo classes that Domo offers as part of the certification do a really good job reviewing the concepts and content to prepare you for the certification. I'd recommend reviewing those before you take the certification test.
Re: Schedule App Studio Reports
Upping this! Our team is really looking forward to seeing this feature live.
Re: Beast mode question
Thank you both for the assistance. This greatly appreciated and it helped a lot.
Re: Beast mode question
If you want to exclude weekdays from the calculation, simply create a column to do so:
case when day(`date_entered`) in (1,7) then 'Exclude' else 'Include' end
Then, in the filters section of analyzer, select only 'Include.'
Domo pivot tables will take care of the rest for ya.
nmizzell



