Hi,
I have a script that automates generating feature services. It all works great except I cannot figure out how to set one property. The feature service has a setting for the preferred time zone for display
Which also shows up in the layer definition if it is set
"preferredTimeReference": {
"timeZone": "Eastern Standard Time",
"respectsDaylightSaving": true
},
I cannot figure out what the name of this setting should be in the sddraft properties. I have tried many variations and it always comes in null. I assume it is setting of another property set along with everything else, but not matter what I try, for example:
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>preferredTimezoneID</Key>
<Value xsi:type="xs:string">UTC</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>preferredTimezoneIDDaylightSavingTime</Key>
<Value xsi:type="xs:string">true</Value>
</PropertySetProperty>
It comes in null in my feature layer definition.
Does anyone know what the correct setting names are?
We are stuck at Pro 3.3 for now, so I cannot use the new features added in 3.4 that would allow me to set via properties.
As a suggestion, it will be really nice if pro allowed you to save out an sddraft, like you could in ArcMap
Hi @JoeHershman,
Here is what I extracted from the .sddraft file
<PropertySetProperty xsi:type='typens:PropertySetProperty'>
<Key>preferredTimeZoneRespectsDayLightSavingTime</Key>
<Value xsi:type='xs:string'>true</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type='typens:PropertySetProperty'>
<Key>preferredTimeZoneID</Key>
<Value xsi:type='xs:string'>GMT Standard Time</Value>
</PropertySetProperty>
Hope that helps.
All the best,
Glen
@Clubdebambos thanks for the reply. Unfortunately those are still not working. I am wondering if they changed something past 3.3 when they modified arcpy.
My sddraft looks like this
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>preferredTimeZoneRespectsDayLightSavingTime</Key>
<Value xsi:type="xs:string">true</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>preferredTimeZoneID</Key>
<Value xsi:type="xs:string">UTC</Value>
</PropertySetProperty>
But still
"datesInUnknownTimezone": false,
"dateFieldsTimeReference": {
"timeZone": "UTC",
"respectsDaylightSaving": false
},
"preferredTimeReference": null,
"types": [
Just to confirm these properties are part of the property set that goes with the FeatureServer as below
<SVCExtension xsi:type="typens:SVCExtension">
<Enabled>true</Enabled>
<Info xsi:type="typens:PropertySet">
<PropertyArray xsi:type="typens:ArrayOfPropertySetProperty">
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>WebEnabled</Key>
<Value xsi:type="xs:string">true</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>WebCapabilities</Key>
<Value xsi:type="xs:string">Create,Sync,Query,Update,Delete,Uploads</Value>
</PropertySetProperty>
</PropertyArray>
</Info>
<Props xsi:type="typens:PropertySet">
<PropertyArray xsi:type="typens:ArrayOfPropertySetProperty">
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>maxRecordCount</Key>
<Value xsi:type="xs:string">2000</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>enableZDefaults</Key>
<Value xsi:type="xs:string">true</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>zDefaultValue</Key>
<Value xsi:type="xs:string">0</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>editorTrackingTimeZoneID</Key>
<Value xsi:type="xs:string">UTC</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>editorTrackingRespectsDayLightSavingTime</Key>
<Value xsi:type="xs:string">true</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>editorTrackingTimeInUTC</Key>
<Value xsi:type="xs:string">true</Value>
</PropertySetProperty>
<!-- Properties removed for brevity -->
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>preferredTimeZoneRespectsDayLightSavingTime</Key>
<Value xsi:type="xs:string">true</Value>
</PropertySetProperty>
<PropertySetProperty xsi:type="typens:PropertySetProperty">
<Key>preferredTimeZoneID</Key>
<Value xsi:type="xs:string">UTC</Value>
</PropertySetProperty>
</PropertyArray>
</Props>
<TypeName>FeatureServer</TypeName>
</SVCExtension>
I have successfully added and modified other properties, so it makes me feel like I am not getting an exact match on this property name
Ah that's a shame. Another option is to use the ArcGIS API for Python after the Feature Service is published and update necessary properties.
That is a thought, I am already using arcgis to get the item ids of the newly created portal items, might as well throw in some json manipulation to make it worth my while 😀
This seemed easy enough. But from what I can see I cannot modify the feature service json with python when the service is on a federated server. This only seems possible on a hosted service. Really annoying, this seems like it should be a simple thing to do