Best Of
Re: Microsoft D365 Finance and Operations Connection
Hi @jackson_obara, I assume that this is the connector for D365: https://www.domo.com/appstore/connector/microsoft-dynamics-crm-connector/overview. Was there anything in particular you were having issues with?
amehdad
Re: How can I change the owner (does not exist in domo anymore) of the custom app to a new one.
Hi @JonavilCello, have your tried using the Command Line Interface (CLI) tool to transfer ownership to your account? You might need to raise a Support request, otherwise.
amehdad
Re: Embedded cards using APIs with pfilters - graph by options
Hi @MrDeanoB, alongside this thread and awaiting the advice of the technical adept users, reach out to Support [support.domo.com] to have them look at it as well (and escalate to Dev if need be). If anything, your case could prompt them to update their documentation.
amehdad
Re: plugin not downloading entire dataset
Hi @abarrie23, in your dataset, would there be any field values that contain operating characters, like a \ or ", in the value?
amehdad
Re: window.addEventListener("message") does not trigger when card is clicked
Hi @xiaodongliang, how did you go with this? What did Support say?
amehdad
Re: window.addEventListener("message") does not trigger when card is clicked
Do you get any error message to help with troubleshooting?
I would suggest also sending this thread, or these screenshots along with an explanation of your situation, to Support [support.domo.com] as they are better equipped to confirm bug or missing elements in your code.
amehdad
Re: Closed Group Owner - grant to add/remove members?
Hi @Jessica, what role is your user currently? I know that being 'Admin' means you can add and remove users from closed groups even if you don't own the groups.
Also, even though that user has been added as a group owner, s/he can't see that they are owner of that group but in your Domo view, you can see that person is owner?
amehdad
Re: Slider Cards not showing all data/options
Hi @D-Rab, the warning message indicates that all of the data is present, but on the card level, the visualization has been truncated. What you should do is reduce the amount of data coming into the dataset you use, or perhaps adding a Search bar on the slider card would enable the other people to come up.
amehdad
Re: Programmatically run a dataflow/dataset
Okay, here we are with the solution to this problem! Special thanks to @jaeW_at_Onyx for all the steps.
I've published https://gist.github.com/giuseppellrusso/03daabba54424ceac83309921121320c#file-domo_utils-py with my module developed to programmatically run a dataset or a dataflow.
As you can see from the code, running a dataset is as easy as running the associated stream and thus we can use the PyDomo library (that is, we are using the official and supported API).
Running the dataflow is a bit trickier, because we have to authenticate to our private instance and use the session token to access an undocumented API. However right now this is working great ?
I also post here the code:
from pydomo import Domo
import logging
import json
import requests
""" Connect to Domo using the Pydomo library and the client id and secret
Documentation:
https://developer.domo.com/docs/authentication/quickstart-5
Args:
client_id (str): client_id to connect with
client_secret (str): client secret to connect with
api_host (str): host of the Domo api
domo_log_level (logging): level of Domo logger. Default set to DEBUG
Returns:
an istance of the Domo object from Pydomo library
"""
def get_domo_connection(client_id, client_secret, api_host, domo_log_level = logging.DEBUG) :
try :
domo = Domo(client_id, client_secret, log_level=domo_log_level, api_host=api_host)
return domo
except Exception as e :
logging.error(e)
raise Exception(e)
""" Gets the stream associated with a Domo dataset
Args:
streams (pydomo object): pydomo object containing the list of streams of a domo instance
dataset_id (str): alphanumeric id of a domo dataset
stream_list_limit (int): limit of streams to retrieve from the pydomo streams object
Returns:
the pydomo stream object of the stream associated with the given dataset
"""
def get_stream_by_dataset_id(streams, dataset_id, stream_list_limit = 2000) :
stream_list = streams.list(stream_list_limit,0)
dataset_streams = [stream for stream in stream_list if stream['dataSet']['id'] == dataset_id]
if(len(dataset_streams)==1):
return dataset_streams[0]
else:
no_stream_found_string = 'No stream found for dataset {}'.format(dataset_id)
logging.error(no_stream_found_string)
raise Exception(no_stream_found_string)
""" Runs a Domo dataset
The method is actually creating a new execution for the stream associated to the dataset
Args:
domo_connection (pydomo object): instance of the pydomo Domo object
dataset_id (str): alphanumeric id of a domo dataset
"""
def run_dataset(domo_connection, dataset_id):
try :
streams = domo_connection.streams
dataset_stream = get_stream_by_dataset_id(streams, dataset_id)
dataset_stream_id = dataset_stream['id']
streams.create_execution(dataset_stream_id)
logging.info('Successfully run dataset id {}'.format(dataset_id))
except Exception as e:
logging.error(e)
raise Exception(e)
""" Gets a session token to be used for undocumented private api
Args:
domo_instance (str): name of the domo instance
email (str): email used to login to the domo instance
password (str): password used to login to the domo instance
Returns:
the session token
"""
def get_session_token(domo_instance, email, password):
auth_api = 'https://{}.domo.com/api/content/v2/authentication'.format(domo_instance)
auth_body = json.dumps({
"method": "password",
"emailAddress": email,
"password": password
})
auth_headers = {'Content-Type' : 'application/json'}
auth_response = requests.post(auth_api, data = auth_body, headers = auth_headers)
auth_status = auth_response.status_code
if auth_status == 200 :
logging.info('Session token acquired.')
return auth_response.json()['sessionToken']
else :
token_error_string = 'Token request ended up with status code {}'.format(auth_status)
logging.error(token_error_string)
logging.error(auth_response.text)
raise Exception(token_error_string)
""" Runs a Domo dataflow
Args:
domo_instance (str): name of the domo instance
domo_token (str): session token used to authenticate to the private apis
dataflow_id (str): id of the dataflow to be run
Returns:
the status of the post request used for running the dataflow
"""
def run_dataflow(domo_instance, domo_token, dataflow_id):
dataflow_api = 'https://{}.domo.com/api/dataprocessing/v1/dataflows/{}/executions'.format(domo_instance, dataflow_id)
dataflow_headers = {'Content-Type' : 'application/json',
'x-domo-authentication' : domo_token}
dataflow_response = requests.post(url = dataflow_api, headers = dataflow_headers)
dataflow_status = dataflow_response.status_code
if dataflow_status == 200 :
logging.info('Successfully run dataflow id {}'.format(dataflow_id))
return dataflow_status
else :
dataflow_error_string = 'Dataflow run request ended up with status code {}'.format(dataflow_status)
logging.error(dataflow_error_string)
logging.error(dataflow_response.text)
raise Exception(dataflow_error_string)Programmatically run a dataflow/dataset
Hello,
I would like your help in order to understand how to run a dataset (or a dataflow) based on a trigger outside Domo.
Let's say, for instance, I have a python script that check a condition on my database and if the condition is met, it should trigger the execution of two mySql Connector in Domo.
Would this be possible somehow?
The closest thing I am able to do is to run manually a dataset or a dataflow with the Java CLI, but I was wondering if there is any API that can accomplish my request so that i can call this API whenever I need it.
I saw in another question an user talking about undocumented API, but I cannot find anything more about it.
It would be enough to understand how the two DOMO CLI commands
| dataflow-run-now |
and
| dataset-run-now |
work in order maybe to emulate the same interaction with my Domo instance programmatically.