queryFeatures get domain description

654
0
02-22-2022 09:33 AM
SteveRailsback
New Contributor

Is it possible to get the domain descriptions when performing queryFeatures? The domain values come down but we need the descriptions to display in our application. Below a screen shop and code snip.

Screen shot 

    loadModules(['esri/layers/FeatureLayer']).then(([FeatureLayer]) => {
      const featureLayer = new FeatureLayer({
        portalItem: {
          id: portalId,
        },
        layerId: layerId,
      })
        .load()
        .then((layer) => {
          layer
            .queryFeatures({

              where: where,
              outFields: '*',
            })
            .then((result: any) => {
              if (result.features.length > 0) {
                const keys = Object.keys(result.features[0].attributes);
                result.features.forEach((f) => {
                  let feature = {};
                  feature['attachments'] = [];
                  keys.forEach((k) => {
                    feature[k] = f.attributes[k];
                  });
                  data.push(feature);
                });
              }
            }).finally(() => {
              resolve(data);
            })
        })
    });

 

 

0 Kudos
0 Replies