Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on April 29, 2020 8:36PM
Likes: 1
Replies: 1
What is the easiest way to load dataset metric variables into a webapp HTML? I understand how to retrieve the metrics in Python (dataset.metrics.last_values) but I can't figure out how to render them to the HTML, in fact, I can't even successfully log them in the console. Simply pasting the sample code below into my JS file fails to log anything in the console.
dataiku.fetch('mydataset',{ sampling : 'head', limit : 15000}, function(dataFrame) { console.log("dataset load succeed"); });
My html looks something like <h1>{{variable}}</h1>
Am i missing a function?
Hi,
First as a side remark, please note that the Javascript API is not as rich as:
For the dataiku.fetch from the Javascript API it will return a DataFrame object from which you won't be able to load the metrics.
If you are interested in the metrics of your dataset you may want to consider creating a metrics dataset from the dataset and fetch this metrics dataset:
That being said, if you indeed have a dataset 'mydataset' in the project where the webapp was created you should be able to perform the dataiku.fetch that you mentioned.
Can you confirm that when you have the browser console opened you don't see the log "dataset load succeed" ? Do you have any error logged in this console?
If not, a possible reason for that would be that the security settings for this webapp or dataset have not been properly configured. Have you configured in the Settings tab of the webapp the Security settings for the 'mydataset' so that you can actually fetch information from this dataset?
I hope this helps.
Regards,