Showing results for 
Show  only  | Search instead for 
Did you mean: 

Visualizations for code response


I took example 2 from here, made it work for my environment. There are events returned and placed into the dataFrame.

Add code to a dashboard | Platform Docs (

But after the RunQuery, there are no Visualizations that can be used.


How can I visualize the values returned?


Dynatrace Helper
Dynatrace Helper

Hi Stephen, 

If your code returns the same data structure as explained in the docs you linked, you should see two visualization options available: 


If this is not the case, can you maybe share your code snippet here (without API-Tokens) and am I happy to check what's the issue. 


// Not the real URL

const environment = "https://{environmentid}"
const token = 
const params = 'api/v2/events';

const uri = environment+params;
const response = await fetch(uri, {
headers: {
Accept: "application/json",
Authorization: "Api-Token " + token

return await response.json()

export default async function () {
const response = await getEvents();
const events =;

const fields = [
{ name: 'eventId', type: 'string' },
{ name: 'eventType', type: 'string' },
{ name: 'status', type: 'string' },
{ name: 'eventTitle', type: 'string' },
{ name: 'startTime', type: 'timestamp' },
{ name: 'endTime', type: 'timestamp' }

// Create a new empty data frame for the result
const dataFrame = {
notifications: [],
records: []

for(let i=0; i<events.length; i++) {
const event = events[i];
const record = {
fields: fields,
values: {
eventTitle: event.title,
eventId: event.eventId,
eventType: event.eventType,
status: event.status,
startTime: event.startTime,
endTime: event.endTime

return dataFrame;

Can you please provide us with a screenshot of what the selection looks like? 





I'm not sure what you mean by selection?


Here is a snapshot of the results.



Hey! Big Sorry! I totally missed your response here. Can you provide a screenshot from your dashboard app where you entered the exampel and where you don't see any visualization suggestions. Also the code response would be interesting.   

Dynatrace Helper
Dynatrace Helper

Hi Stephen, 

I am sorry, but I can't reproduce your issue. If I take the code you sent me and execute it in my environment, I do get results back. Initially, it's visualized in a "Record List". Do you have some results within the Record List? 


When I switch to the "Visualizations" tab, I have the possibility to select either the Table or the Single Value visualization. 




I turned on the browser tools and under preview I do seem some records and event data.



But I'm still unable to visualize the results.

Is there perhaps a version or permissions issue?

Thank you


Dynatrace Helper
Dynatrace Helper

Hi Stephen, 

Sorry for the late reply. I have identified the issue you're having. When the code block is too large, you can't scroll down to the visualization options. This is a bug in the currently deployed version of Dashboards. We have already fixed this and will deploy this to your environments within the next few days. I'll update you when this is done. 

Sorry for the inconvenience. 


Hey Christian! 

I am having a similar issue. I am using the same code as in the example, and I see the visualization options but it says the table option is unsupported and can't be selected. The raw data looks as expected. Preview version is v0.13.1. Is there a newer one that allows those options to be used?


- David

Featured Posts