Select to view content in your preferred language

create_view works in ArcGIS Online, not from ArcPro

66
3
yesterday
Labels (3)
RandyMcGregor_BMcD
Frequent Contributor

I have a notebook that creates views from user-specified hosted feature layers. The notebook works fine and until I updated to 3.4, the notebook could be downloaded and run from ArcPro. I have also made a python script tool with ArcGIS API for Python code that included create_view and until I updated to ArcPro 3.4 worked fine.

So, it appears as though this particular functionality will not work when run from an ArcPro project, either from a notebook or a script tool. It still works fine run from an ArcGIS Online-hosted notebook. Has anyone else experienced this? Is this a bug? 

Creating services and applying metadata and settings does work from ArcPro. Again, appears to be a problem with create_view.

The error message is error:(unkown error), unfortunately. Three people have gotten the same error when activating this functionality from ArcPro (either as a downloaded notebook or python script tool). It's pretty consistent.

This is the code that creates the view. Pretty straightforward.

 

#
# 2. Create the view.
#--------------------------------------------------------------------------------------------------
new_view_name = Service_Title+"_View"
new_view_name = View_Name
arcpy.AddMessage("> Creating view "+new_view_name+"...")
new_view = flc.manager.create_view(new_view_name)

 

 

3 Replies
RandyMcGregor_BMcD
Frequent Contributor

One more detail. A view is created. But it is incomplete. The next line in the code is an arcpy.AddMessage line, which does not run, so nothing after the create_view line is causing the problem.

0 Kudos
NanaeAubry
Esri Contributor

You might have different versions of the Python API in each notebook environment. The best way to check what version you are running is:

```

import arcgis

arcgis.__version__

```

RandyMcGregor_BMcD
Frequent Contributor

Yes. They are different. ArcPro is a higher number (2.4.0). I'm assuming I need to check with IT about updating the AGOL Python API version.

0 Kudos