I am working on a web app where I am making calls to a database api and it returns a JSON Object. I've managed to do so successfully as well as any manipulations that need be done.
Is there a way to add new fields to a FeatureLayer and the subsequently populate with the relevant data?
I do not necessarily want to edit the feature layer, just attach data on the fly so that I can then use it for analysis such as heat maps and what not. Have not really found anything concrete in the api documentation.
Ive tried the following code that results in an error. Fairly certain it is because i am trying to set the value before I add the Field.
featureLayer = new FeatureLayer(....);
fieldName = x;
value = y;
featureLayer.graphics.attributes.fieldName = value;