On portal 11.1, I have great difficulty creating a usable webmap. I created a mapservice and when formatting fields I notice that the attributes were showing code values rather than the domain values. I am working with a mapservice because I need to use symbols that can rotate by attributes and with the map.
When you published the service, did you render the layers by the Subtype/Asset Group? If not, you need to. This sets the Type field, which many clients use for subtype info.
If you did and it is still not working, did you increase the coded value domain code on the service?
Thanks, I have to look into this.
@MikeMillerGIS - They mentioned they are using 11.1 so possibly not published using subtype group layers?
@MariaThors - Mike's suggestion about increasing the coded domain value has helped us resolve similar issues where the domain code shows up instead of the description.
In the odd case we have used arcade to get the domain description.
Example code -
"kVA RATING (max)" : DomainName($feature,"tx_kva_rating_max")
If you aren't using subtype group layers then below is another way you can customize attribute set per ASSETGROUP and ASSETTYPE. Something you may find handy setting up the map.
//ICP
if ($feature.ASSETGROUP == 1 && $feature.ASSETTYPE == 1) {
return {
type: "fields",
fieldInfos: [{ fieldName: "ASSET ID" },
{ fieldName: "ICP NAME" },
{ fieldName: "PREMISE TYPE" },
{ fieldName: "CUSTOMER NAME" },
{ fieldName: "CUSTOMER HOME PHONE" },
{ fieldName: "CUSTOMER BUSINESS PHONE" },
{ fieldName: "CUSTOMER MOBILE PHONE" },
{ fieldName: "CUSTOMER EMAIL" },
{ fieldName: "REGISTRY STATUS" },
{ fieldName: "DISCONNECT RESTRICTION" },
{ fieldName: "DISCONNECT RESTRICTION TYPE" },
{ fieldName: "FUSE SIZE" },
{ fieldName: "PRICING PLAN" },
{ fieldName: "METER LIST"}
],
attributes:
{
"ASSET ID": $feature.asset_id,
"ICP NAME":$feature.icp_ICPName,
"PREMISE TYPE": $feature.icp_PremiseType,
"CUSTOMER NAME": $feature.icp_CustName,
"CUSTOMER HOME PHONE":$feature.icp_CustHomePhone,
"CUSTOMER BUSINESS PHONE":$feature.icp_CustBusPhone,
"CUSTOMER MOBILE PHONE":$feature.icp_CustMobilePhone,
"CUSTOMER EMAIL":$feature.icp_CustEmail,
"REGISTRY STATUS":$feature.icp_RegistryStatus,
"DISCONNECT RESTRICTION":$feature.icp_DisconnectRestriction,
"DISCONNECT RESTRICTION TYPE":$feature.icp_MedicalRestrictionType,
"FUSE SIZE":$feature.icp_FuseSize,
"PRICING PLAN":$feature.icp_PricingPlan,
"METER LIST":$feature.icp_MeterList
}
};
} //Streetlight
else if ($feature.ASSETGROUP == 1 && $feature.ASSETTYPE == 2) {
return {
type: "fields",
fieldInfos: [{ fieldName: "ASSET ID" }],
attributes: { "ASSET ID": $feature.asset_id }
};
} //Misc End Point
else if ($feature.ASSETGROUP == 1 && $feature.ASSETTYPE == 3) {
return {
type: "fields",
fieldInfos: [{ fieldName: "ASSET ID" }, { fieldName: "ASSET NOTES" }],
attributes:
{ "ASSET ID": $feature.asset_id, "ASSET NOTES": $feature.asset_notes }
};
} //Power Transformer and Distribution Transformer
else if ($feature.ASSETGROUP == 2 || $feature.ASSETGROUP == 3 ) {
return {
type: "fields",
fieldInfos: [
{ fieldName: "ASSET ID" },
{ fieldName: "FEEDER" },
{ fieldName: "DATE INSTALLED" },
{ fieldName: "OWNED BY" },
{ fieldName: "MANUFACTURER" },
{ fieldName: "MANUFACTURUER DATE" },
{ fieldName: "MODEL" },
{ fieldName: "SERIAL NUMBER" },
{ fieldName: "kVA RATING (max)" },
{ fieldName: "kVA RATING (min)" },
{ fieldName: "TRANSFORMER VECTOR" },
{ fieldName: "PRIMARY VOLTAGE" },
{ fieldName: "SECONDARY VOLTAGE" },
{ fieldName: "MAXIMUM TAP" },
{ fieldName: "MINIMUM TAP" },
{ fieldName: "CURRENT TAP" },
{ fieldName: "NUMBER OF TAPS" },
{ fieldName: "TAP %" },
{ fieldName: "COOLING" },
{ fieldName: "CURRENT TAP" },
{ fieldName: "IMPEDANCE" },
{ fieldName: "NO LOAD LOSSES" },
{ fieldName: "FULL LOAD LOSSES" },
{ fieldName: "WEIGHT" },
{ fieldName: "OIL CAPACITY" },
{ fieldName: "ASSET NOTES" },
{ fieldName: "MAPA ID" }
],
attributes:
{
"ASSET ID" : $feature.asset_id,
"FEEDER" : $feature.SUBNETWORKNAME,
"DATE INSTALLED" : $feature.date_installed,
"OWNED BY" : $feature.owned_by,
"MANUFACTURER" : $feature.manufacturer,
"MANUFACTURUER DATE" : Text($feature.manufacture_date,'DD-MMM-YYYY'),
"MODEL" : $feature.model,
"SERIAL NUMBER" : $feature.serial_number,
"kVA RATING (max)" : DomainName($feature,"tx_kva_rating_max"),
"kVA RATING (min)" : DomainName($feature,"tx_kva_rating_min"),
"TRANSFORMER VECTOR" : $feature.tx_vector,
"PRIMARY VOLTAGE" : DomainName($feature, "tx_primary_voltage"),
"SECONDARY VOLTAGE" : DomainName($feature, "tx_secondary_voltage"),
"MAXIMUM TAP" : $feature.tx_tap_maximum,
"MINIMUM TAP" : $feature. tx_tap_minimum,
"CURRENT TAP" : $feature.tx_tap_current,
"NUMBER OF TAPS" : $feature.tx_tap_number,
"TAP %" : $feature.tx_tap_percentage,
"COOLING" : DomainName($feature, "tx_cooling"),
"IMPEDANCE" : $feature.tx_impedance,
"NO LOAD LOSSES" : $feature.tx_load_losses_none,
"FULL LOAD LOSSES" : $feature. tx_load_losses_full,
"WEIGHT" : $feature.tx_total_weight,
"OIL CAPACITY" : $feature.tx_oil_capacity,
"ASSET NOTES" : $feature.asset_notes,
"MAPA ID" : $feature.mapa_id
}
};
}
//High Voltage and Subtransmission Switches
else if ($feature.ASSETGROUP == 5 || $feature.ASSETGROUP == 8 ) {
return {
type: "fields",
fieldInfos: [
{ fieldName: "ASSET ID" },
{ fieldName: "FEEDER" },
{ fieldName: "DATE INSTALLED" },
{ fieldName: "OWNED BY" },
{ fieldName: "MANUFACTURER" },
{ fieldName: "MANUFACTURUER DATE" },
{ fieldName: "MODEL" },
{ fieldName: "SERIAL NUMBER" },
{ fieldName: "ISOLTAING MEDIUM" },
{ fieldName: "REMOTE OPERATION" },
{ fieldName: "HANDLE OPERATION" },
{ fieldName: "SWITCH MOUNTING" },
{ fieldName: "SWITCH STATE" },
{ fieldName: "LOAD BREAK RATING" },
{ fieldName: "RATED VOLTAGE" },
{ fieldName: "NOMINAL VOLTAGE" },
{ fieldName: "OPERATING VOLTAGE" },
{ fieldName: "CURRENT RATING" },
{ fieldName: "SHORT CIRCUIT RATING" },
{ fieldName: "ASSET NOTES" },
{ fieldName: "MAPA ID" }
],
attributes:
{
"ASSET ID" : $feature.asset_id,
"FEEDER" : $feature.SUBNETWORKNAME,
"DATE INSTALLED" : $feature.date_installed,
"OWNED BY" : $feature.owned_by,
"MANUFACTURER" : $feature.manufacturer,
"MANUFACTURUER DATE" : Text($feature.manufacture_date,'DD-MMM-YYYY'),
"MODEL" : $feature.model,
"SERIAL NUMBER" : $feature.serial_number,
"ISOLTAING MEDIUM" : DomainName($feature, "switch_isolating_medium"),
"REMOTE OPERATION" : DomainName($feature, "switch_remote_operation"),
"HANDLE OPERATION" : DomainName($feature, "switch_handle_operation"),
"SWITCH MOUNTING" : DomainName($feature, "switch_mounting"),
"SWITCH STATE" : DomainName($feature, "switch_normal_state"),
"LOAD BREAK RATING" : $feature.switch_load_break_rating ,
"RATED VOLTAGE" : $feature.rated_voltage,
"NOMINAL VOLTAGE" : DomainName($feature, "nominal_voltage"),
"OPERATING VOLTAGE" : DomainName($feature, "operating_voltage"),
"CURRENT RATING" : DomainName($feature, "current_rating"),
"SHORT CIRCUIT RATING" : $feature.short_circuit_rating,
"ASSET NOTES" : $feature.asset_notes,
"MAPA ID" : $feature.mapa_id
}
};
}
//High Voltage Arrestor and Subtransmission Arrestor
else if ($feature.ASSETGROUP == 14) {
return {
type: "fields",
fieldInfos: [
{ fieldName: "ASSET ID" },
{ fieldName: "DATE INSTALLED" },
{ fieldName: "OWNED BY" },
{ fieldName: "ASSET NOTES" },
{ fieldName: "MAPA ID" }
],
attributes:
{
"ASSET ID" : $feature.asset_id,
"FEEDER" : $feature.SUBNETWORKNAME,
"DATE INSTALLED" : $feature.date_installed,
"OWNED BY" : $feature.owned_by,
"ASSET NOTES" : $feature.asset_notes,
"MAPA ID" : $feature.mapa_id
}
};
}
// LV, HV, Subtrans Fuse
else if ($feature.ASSETGROUP == 6 || $feature.ASSETGROUP == 7 || $feature.ASSETGROUP == 9 || $feature.ASSETGROUP == 10 || $feature.ASSETGROUP == 11 || $feature.ASSETGROUP == 12 ) {
return {
type: "fields",
fieldInfos: [
{ fieldName: "ASSET ID" },
{ fieldName: "DATE INSTALLED" },
{ fieldName: "OWNED BY" },
{ fieldName: "FUSE HOLDER TYPE" },
{ fieldName: "FUSE HOLDER RATING" },
{ fieldName: "CURRENT RATING" },
{ fieldName: "ASSET NOTES" },
{ fieldName: "MAPA ID" }
],
attributes:
{
"ASSET ID" : $feature.asset_id,
"FEEDER" : $feature.SUBNETWORKNAME,
"DATE INSTALLED" : $feature.date_installed,
"OWNED BY" : $feature.owned_by,
"FUSE HOLDER TYPE" : $feature.fuse_holder_type,
"FUSE HOLDER RATING" : $feature.fuse_holder_rating,
"CURRENT RATING" : $feature.current_rating,
"ASSET NOTES" : $feature.asset_notes,
"MAPA ID" : $feature.mapa_id
}
};
}
//Ground Point
else if ($feature.ASSETGROUP == 13) {
return {
type: "fields",
fieldInfos: [
{ fieldName: "ASSET ID" },
{ fieldName: "DATE INSTALLED" },
{ fieldName: "OWNED BY" },
{ fieldName: "ASSET NOTES" },
{ fieldName: "MAPA ID" }
],
attributes:
{
"ASSET ID" : $feature.asset_id,
"FEEDER" : $feature.SUBNETWORKNAME,
"DATE INSTALLED" : $feature.date_installed,
"OWNED BY" : $feature.owned_by,
"ASSET NOTES" : $feature.asset_notes,
"MAPA ID" : $feature.mapa_id
}
};
}
Thank you, I think this will be really helpful as one does not need to show all attributes in a webmap.