Hi Community,
I'm trying to add associations with a REST call and got stuck when trying to identify the 'networksourceid' in the TO/FROM attributes of body. I'm hoping there is either a table of ids I can reference or that this is identified somewhere else.
When I reviewed previous association adds and deletes, the networksourceid I saw in the calls didn't line up with expectations. Meaning, I expected the ids to be the same as the layer index in the feature service. They are not.
Help and guidance are much appreciated!
Solved! Go to Solution.
You can call `queryDataElement` rest call on the feature service and provide the utility network layer id.
https://server.esri.com/server/rest/services/service_name/FeatureServer/queryDataElements
[13] is the utility network layer id
You can find the utility network layer id querying the feature service definition and looking up utilityNetworkdatasetId "controllerDatasetLayers": {
"utilityNetworkLayerId": 13
},
You can call `queryDataElement` rest call on the feature service and provide the utility network layer id.
https://server.esri.com/server/rest/services/service_name/FeatureServer/queryDataElements
[13] is the utility network layer id
You can find the utility network layer id querying the feature service definition and looking up utilityNetworkdatasetId "controllerDatasetLayers": {
"utilityNetworkLayerId": 13
},
Thank you! I got what I needed from your first suggestion. I'm fairly new to working with the REST API and didn't quite understand you second comment. Please expand if you like, but I've marked your solution as solved all the same.
The utilitynetwork layer id will be different for each feature service. You can find the utility network layer id dynamically for any feature service (if it exists) by querying the feature service definition.
Ah, thank you. That helped. I did not realize it could change from service to service.