How do I find a list of networksourceid?

480
4
Jump to solution
09-07-2021 09:19 AM
LoganSuhr_PSE
New Contributor III

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!

0 Kudos
1 Solution

Accepted Solutions
HusseinNasser2
Esri Contributor

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 

 

HusseinNasser2_0-1631032908962.png

 

HusseinNasser2_1-1631032937722.png

 

You can find the utility network layer id  querying the feature service definition and looking up utilityNetworkdatasetId "controllerDatasetLayers": {
"utilityNetworkLayerId": 13
},

 

View solution in original post

4 Replies
HusseinNasser2
Esri Contributor

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 

 

HusseinNasser2_0-1631032908962.png

 

HusseinNasser2_1-1631032937722.png

 

You can find the utility network layer id  querying the feature service definition and looking up utilityNetworkdatasetId "controllerDatasetLayers": {
"utilityNetworkLayerId": 13
},

 

LoganSuhr_PSE
New Contributor III

@HusseinNasser2,

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. 

0 Kudos
HusseinNasser2
Esri Contributor

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. 

 

 

0 Kudos
LoganSuhr_PSE
New Contributor III

Ah, thank you.  That helped.  I did not realize it could change from service to service.

0 Kudos