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-KufqXjtm8PBxxxxxommIBGzPECSrBrjSVZMG135nXa4BusS2LamyWkRiiooiBYgRUxp9 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'", "", "")