Displaying Attributes in a Geocode Task
Hi There,
I've created a geocode workflow that is based off of the one in the (https://support.geocortex.com/using-workflow-with-a-geocode-task) code gallery . All has been working well but I'm looking to extend it and add in a few extra attributes from my GeocodeServer. It is outlined that you can add additional data by using the syntax: graphic.Attributes("FIELDNAME") = data. I have tried to do this to give the range of addresses for each section (ie RightFrom and RightTo).
So I am having trouble calling the fields based on field name. result is the name of the AddressCandidate. So result.score returns the score, result.address returns the address from the geocode service. result.Attributes is supposed to return field attributes but it is not working with the name of the field. When I leave it blank (ie result.attributes), it returns System.Collections.Generic.Dictionary`2[System.String,System.Object]. When i add a field name (ie result.attributes("RightTo")), an error is thrown and says that "the given key was not present in the dictionary".
I'm hoping someone can provide any intel on how to call attributes if it is not by field name. I'm sure I'm doing something silly to mess it up, but it is frustrating and there is minimal documentation on this.
Thanks!
-
You will need to set the fields you want included in this dictionary as 'outFields' in the parameters of the Geocoding task. Have you done this?
You won't see this parameter in the main display, as it is entirely optional, but you should see it in the full list on the right hand side when you select the Geocode activity in Workflow. Here you can supply a comma separated list of fields to be returned, and then they should show up in the Attributes dictionary, which will be blank by default.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar