Get Item ID from new Dashboard object via Python API

209
2
Jump to solution
4 weeks ago
Labels (1)
JPrescott
New Contributor II

Using ArcGIS API for Python, I've successfully created a new Dashboard object and saved it using the following code.  I can confirm the Dashboard has been created by opening it from My Content.  However, in the code, it only seems to exist as a Dashboard object.  The rest of my workflow involves gis.content.get() which requires the Item ID.  Does anyone know how I can get the Item ID from the Dashboard object?

 

    new_dash = Dashboard()
    new_dash.save('new_dash6')
    pprint(new_dash)

 

The print statement yields the Dashboard object:

<arcgis.apps.dashboard.dashboard.Dashboard object at 0x00000209EB6D66D0>

The next step would be to get the Dashboard JSON, but I need the Item ID:

 

new_dash_item = gis.content.get(new_dash_item_id)

 

 

0 Kudos
1 Solution

Accepted Solutions
EarlMedina
Esri Regular Contributor

save returns the item, so all you have to do is:

 

 

new_dash = Dashboard()
new_dash_item = new_dash.save('new_dash6')
# do something with new_dash_item

 

 

 

View solution in original post

0 Kudos
2 Replies
EarlMedina
Esri Regular Contributor

save returns the item, so all you have to do is:

 

 

new_dash = Dashboard()
new_dash_item = new_dash.save('new_dash6')
# do something with new_dash_item

 

 

 

0 Kudos
JPrescott
New Contributor II

Perfect, that did it, and thank you!

0 Kudos