Select to view content in your preferred language

temp1 = Templates.MONITOR

257
1
08-27-2024 02:03 AM
Labels (3)
CS_IBM
by
Occasional Contributor

Greetings,
The ESRI "Working with Web Experiences in the Python API" in Class Basics.
It states the following code snipit.

# import the module from the apps folder, and establish a GIS connection.
from arcgis.apps.expbuilder import WebExperience
from arcgis.gis import GIS
gis = GIS(profile="your_online_profile")

# template enum class example
from arcgis.apps.expbuilder import Templates
temp1 = Templates.MONITOR

# if using a notebook, can preview the template by calling preview()
temp1.preview()

 

When I call my Template, I get an error??

temp1 = Templates.COASTAL
print(temp1)


The Error message.

AGOL LOGIN
CONNECTED to AGOL
Traceback (most recent call last):
File "C:\Users\ci000030\PycharmProjects\DEV\.venv\DEV\Upload_Coastal.py", line 36, in <module>
temp1 = Templates.COASTAL
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\enum.py", line 429, in __getattr__
raise AttributeError(name) from None
AttributeError: COASTAL

 

1 Reply
Clubdebambos
Frequent Contributor

Hi @CS_IBM 

There is no COASTAL in the Templates enum, hence the error. The Templates enum options are listed below.

 |  AVATARBOARD = <Templates.AVATARBOARD: 'avatarboard'>
 |  
 |  BILLBOARD = <Templates.BILLBOARD: 'billboard'>
 |  
 |  BLANKFULLSCREEN = <Templates.BLANKFULLSCREEN: 'blank_fullscreen'>
 |  
 |  BLANKSCROLLABLE = <Templates.BLANKSCROLLABLE: 'blank_scrollable'>
 |  
 |  BLANKSCROLLING = <Templates.BLANKSCROLLING: 'blank_scrolling'>
 |  
 |  BOOKING = <Templates.BOOKING: 'booking'>
 |  
 |  CHECKERBOARD = <Templates.CHECKERBOARD: 'checkerboard'>
 |  
 |  CHRONOLOGY = <Templates.CHRONOLOGY: 'chronology'>
 |  
 |  COLLAGE = <Templates.COLLAGE: 'collage'>
 |  
 |  COMPARATIST = <Templates.COMPARATIST: 'comparatist'>
 |  
 |  DART = <Templates.DART: 'dart'>
 |  
 |  DASH = <Templates.DASH: 'dash'>
 |  
 |  DASHBOARD = <Templates.DASHBOARD: 'dashboard'>
 |  
 |  DATACOLLECTOR = <Templates.DATACOLLECTOR: 'data_collector'>
 |  
 |  ELEVATE = <Templates.ELEVATE: 'elevate'>
 |  
 |  EPIC = <Templates.EPIC: 'epic'>
 |  
 |  EVENTS = <Templates.EVENTS: 'events'>
 |  
 |  EXHIBITION = <Templates.EXHIBITION: 'exhibition'>
 |  
 |  FOLDABLE = <Templates.FOLDABLE: 'foldable'>
 |  
 |  FRAME = <Templates.FRAME: 'frame'>
 |  
 |  GALLERY = <Templates.GALLERY: 'gallery'>
 |  
 |  GEAR = <Templates.GEAR: 'gear'>
 |  
 |  GENERAL = <Templates.GENERAL: 'general'>
 |  
 |  ILLUSTRATOR = <Templates.ILLUSTRATOR: 'illustrator'>
 |  
 |  INDICATOR = <Templates.INDICATOR: 'indicator'>
 |  
 |  INTRODUCTION = <Templates.INTRODUCTION: 'introduction'>
 |  
 |  JEWELERYBOX = <Templates.JEWELERYBOX: 'jewelrybox'>
 |  
 |  JOURNEY = <Templates.JOURNEY: 'journey'>
 |  
 |  KIT = <Templates.KIT: 'kit'>
 |  
 |  LAUNCHPAD = <Templates.LAUNCHPAD: 'launchpad'>
 |  
 |  LEAFLET = <Templates.LEAFLET: 'leaflet'>
 |  
 |  LENS = <Templates.LENS: 'lens'>
 |  
 |  MAPFLYER = <Templates.MAPFLYER: 'mapflyer'>
 |  
 |  MONITOR = <Templates.MONITOR: 'monitor'>
 |  
 |  MULTIVERSE = <Templates.MULTIVERSE: 'multiverse'>
 |  
 |  PAMPHLET = <Templates.PAMPHLET: 'pamphlet'>
 |  
 |  PANORAMA = <Templates.PANORAMA: 'panorama'>
 |  
 |  PARALLAX = <Templates.PARALLAX: 'parallax'>
 |  
 |  POCKET = <Templates.POCKET: 'pocket'>
 |  
 |  QUICKNAVIGATION = <Templates.QUICKNAVIGATION: 'quick_navigation'>
 |  
 |  REVEAL = <Templates.REVEAL: 'reveal'>
 |  
 |  RIBBON = <Templates.RIBBON: 'ribbon'>
 |  
 |  ROUTE = <Templates.ROUTE: 'route'>
 |  
 |  SCENIC = <Templates.SCENIC: 'scenic'>
 |  
 |  SEEKER = <Templates.SEEKER: 'seeker'>
 |  
 |  SHOWROOM = <Templates.SHOWROOM: 'showroom'>
 |  
 |  SKETCHBOOK = <Templates.SKETCHBOOK: 'sketchbook'>
 |  
 |  SNAPSHOT = <Templates.SNAPSHOT: 'snapshot'>
 |  
 |  SUMMARY = <Templates.SUMMARY: 'summary'>
 |  
 |  TIMELINE = <Templates.TIMELINE: 'timeline'>
 |  
 |  VACATION = <Templates.VACATION: 'vacation'>
 |  
 |  VOYAGE = <Templates.VOYAGE: 'voyage'>

 

~ learn.finaldraftmapping.com
0 Kudos