AnsweredAssumed Answered

If statement for multiple feature layers infotemplate

Question asked by bg3075 on Aug 28, 2013
Latest reply on Aug 30, 2013 by vinaybansal
I have added two FeatureLayers to query attributes from in an infotemplate (popup). What I would like to figure out is how to write an if statement that states if one attribute is undefined ("SHELTER") to use another attribute field ("BUILDING"), and add to the following function. Is this possible?
function getTextContent(graphic) { //continuation of popup feature             var bldg = "<br /><br />Shelter: " +graphic.attributes.SHELTER + "<br /><br />Shelter Room: " +graphic.attributes.LOCATION; //fields, within the featureLayer, to return information for             return  bldg;         } 
Or, another idea, is how to simply have it always query the top-most layer attributes? I think that would solve my problem as well.

Outcomes