Hi there,
I have looked at your codepen. I updated a few things in your codepen to make your current workflow work. Mainly, you should not set outFields instead you have to set the fields property for the new FeatureLayer. See below:
layer = new FeatureLayer({
objectIdField: "OBJECTID",
source: featureSet.features,
fields: featureSet.fields,
popupTemplate: {
content: "{name1} in {city} has {OBJECTID}"
},
renderer: newRend
});
Here is the updated codepen.
However, I am not sure why you are creating a new FeatureLayer every time users enter a new input. This can lead to sluggish and slow performing app. You should be able to set all of what you are setting on a new featurelayer on your pointservice featurelayer. When user enters an input, call queryFeatures, zoom to that feature all without have to create a new featurelayer everytime!