Changing attributes displayed in result details from geocoding service
I'm working on developing a workflow that allows the user to search by street address, using an organizational geocoding service. I'm using the workflow template provided by Amanda Frech (https://support.vertigis.com/hc/en-us/community/posts/18162780096530/comments/18724704193042), and while this workflow works well, the Results Details includes all of the “Candidate Fields” returned by the geocoding service:
Is there a way to control the Candidate Fields that are returned by the geocoding service, or what/how they are displayed in the Results Detail page? For instance, I just want a couple of attribute fields displayed in the details pane, like “Match_addr”, “Score”, the XY coordinates, etc. I would also like to rename “Match_addr” to something more legible like “Street Address” or “Matched Address”, etc.
Normally I would make these changes in the web map in Portal or ArcGIS Online, but because these field are returned by the geocoding service during the workflow, that's not an option.
I assumed I would make changes in my Show Results component, but I'm not sure how…
Thanks!
-
Replying to my own comment. I eventually figured out that I can at least limit the Candidate fields being returned from the geocoding service by adding the fields I want to keep in the Geocode activities “Out Fields” parameter. This must be a simple comma-separated list (no brackets around the list, no quotes around the fields names).
So, for instance, if I just want to return the matching address, match score, and X/Y coordinates, I would add this to the “Out Fields” parameter:I'm still hoping there is a way to alter the returned Candidate field names, for instance changing “Match_addr” to something more readable like “Matching Address”…
1 -
You can totally change those attribute names, I'm not sure about giving them spaces but you could certainly try to give the fields aliases and see if it works.
I would probably do a renaming in the input to the Create Feature activity “feature1”. Instead of just passing through the attributes that you want, use a custom object e.g.
={ Attribute_One: $forEach1.item.attributes.attr1, Attribute_Three: $forEach1.item.attributes.attributeThree, Attribute_Number_Eight: $forEach1.item.attributes.attr8, }
This will get you most of the way there anyway.
For setting aliases, you could try using a Create Feature Set activity with the array of features as its input. Then before supplying that activity's .featureSet result to the Show Results feature, try setting the aliases of any .featureSet.fields that you'd like. You will probably do that in a Set Property activity with some fun JS array functions like .find() to bind to the proper field object. I'm not positive those fields will be there off hand though, since you'd build the Feature Set in a roundabout way. There are ways to make that property from scratch but I'd have to figure em out.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare