Select to view content in your preferred language

AttributeError: 'tuple' object has no attribute 'content'

1741
2
Jump to solution
06-14-2022 02:33 AM
FrederikPicavet
Occasional Contributor

Hi,

We work on a dedicated hosted version, so not the cloud solution.
When we launch the scripts we manage to load everything to start with.

so:
import arcgis
from arcgis.apps import workforce
from arcgis geocoding import geocode


whe define our portal username password and portal url in a second phase
so:
portal_username ="our username"
portal_password = "our password"
portal_url = "our url"

now when we enter in the third phase where we want to open the layer
gis = arcgis.gis.GIS(portal_url), "workforce_scripts" 
gis.conten.get("the_unique_name_in_the_url_of_the_workforce_layer)
project = workforce.project(item)

this second line generates the following error:

AttributeError: 'tuple' object has no attribute 'content' 

does anyone knows what we should look for?

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

gis = arcgis.gis.GIS(portal_url), "workforce_scripts"

"workforce_scripts" does this need to be comment out?   It should have caused the script to error


... sort of retired...

View solution in original post

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

gis = arcgis.gis.GIS(portal_url), "workforce_scripts"

"workforce_scripts" does this need to be comment out?   It should have caused the script to error


... sort of retired...
0 Kudos
FrederikPicavet
Occasional Contributor

Hi

Thank you .

 

I cut of the "workforce_scripts" , and no more errors

gis = arcgis.gis.GIS(portal_url, portal_username, portal_password)
item = gis.content.get("code of the wf project")
project = workforce.Project(item)

 

0 Kudos