Select to view content in your preferred language

Make Table View Error

689
3
Jump to solution
09-25-2024 07:22 AM
kapalczynski
Frequent Contributor

arcpy.management.MakeTableView has been working in the past but not sure why its suddenly not working.. still have to see if there were upgrades etc that might have effected this but figured I would see if there was something i was doing wrong ... 

If I run the script I get an error

File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Table: Dataset https://url/hosting/rest/services/Hosted/Adopt/FeatureServer/1?token=XXR3Pg4riCpWUxGaZ691nv8G6JKmO3-... does not exist or is not supported
Failed to execute (MakeTableView).

 BUT if I copy that URL with the token as seen above in the error it navigates and opens the REST for that table with NO issues... It exists... why is it telling me it does not exist or not supported... Does this NOT work on an Enterprise Hosted Feature Layer?

 

# VERSION 1
    url = r"https://url/hosting/rest/services/Hosted/Adopt/FeatureServer/"
    inputFeatureTable = url + '1'  # index of 1 meaning the TABLE 
    whereClause = "IMPORTED = 'No'"
    arcpy.management.MakeTableView(inputFeatureTable, "fLyr", whereClause, "", "")

# VERSION 2
    inputFeatureTable = r"https://url/hosting/rest/services/Hosted/Adopt/FeatureServer/1?token=" + currenttoken
    whereClause = "IMPORTED = 'No'"
    arcpy.management.MakeTableView(inputFeatureTable, "fLyr", whereClause, "", "")
    
# VERSION 3    
arcpy.management.MakeTableView(r"https://url/hosting/rest/services/Hosted/Adopt/FeatureServer/1?token=" + currenttoken, "fLyr", "IMPORTED = 'No'", "", "")

 

0 Kudos
1 Solution

Accepted Solutions
BrandonMcAlister
Frequent Contributor

@kapalczynski 

Are you the owner of the table? If not, see if you can create an editing group and have the table shared to that group. So you have permission to view and edit the table. 

If you are the owner the table, are you able to sign into enterprise within the script, or are you signed into enterprise when running the script? 

Based on what you have said it sounds like its a viewing/permissions error that can be caused by your account permissions. Did your organization recently update enterprise, you may have been assigned the wrong user type.

https://doc.arcgis.com/en/arcgis-online/administer/user-types-orgs.htm

Thanks,
Brandon

View solution in original post

3 Replies
kapalczynski
Frequent Contributor

For some reason if the hosted FL is not shared public I cannot edit it or see it?  That's really weird.. EVEN if I have a token it give that error... 
I Make it public and it works... BUT I cannot have this public...  Thoughts?

 

0 Kudos
BrandonMcAlister
Frequent Contributor

@kapalczynski 

Are you the owner of the table? If not, see if you can create an editing group and have the table shared to that group. So you have permission to view and edit the table. 

If you are the owner the table, are you able to sign into enterprise within the script, or are you signed into enterprise when running the script? 

Based on what you have said it sounds like its a viewing/permissions error that can be caused by your account permissions. Did your organization recently update enterprise, you may have been assigned the wrong user type.

https://doc.arcgis.com/en/arcgis-online/administer/user-types-orgs.htm

Thanks,
Brandon
kapalczynski
Frequent Contributor

@BrandonMcAlister  Thanks... Yea that seems to have been it... Weird... I was using an Admin User to do this edit... I just assumed because it was an admin user it would have global permissions to make the edit... As soon as I added it to the group it worked... THANKS AGAIN