How to Parse Unique Values from JSON Multiple Tokens?
My worfklow sends a URL request and returns a JSON string back. I've figured out how to parse out a single value from a single token. However, I need to parse out unique values that may get returned from multiple tokens.
My example below illustrates the need to pull out all the unique "routeID" values and their corresponding 'measure' value and put them in a list.
JSON Example:
{"unitsOfMeasure":"esriMiles","spatialReference":{"wkid":102100},"locations":[{"status":"esriLocatingMultipleLocation","results":[{"routeId":"S001920030E5755","measure":0.25416746179235783,"geometryType":"esriGeometryPoint","geometry":{"x":-10420718.806398915,"y":5161689.6900920263,"z":0}},{"routeId":"S001920030W5765","measure":0.37050808493222576,"geometryType":"esriGeometryPoint","geometry":{"x":-10420607.58377021,"y":5161861.2917503668,"z":0}},{"routeId":"S001920030W5770","measure":0.099464873585683428,"geometryType":"esriGeometryPoint","geometry":{"x":-10420799.175091986,"y":5161856.011960688,"z":0}},{"routeId":"S001920069N","measure":115.10814346868526,"geometryType":"esriGeometryPoint","geometry":{"x":-10420607.145267591,"y":5161727.4648364792,"z":0}},{"routeId":"S001920030W","measure":181.81220722153694,"geometryType":"esriGeometryPoint","geometry":{"x":-10420723.090636296,"y":5161728.8419408929,"z":0}},{"routeId":"S001920030E","measure":148.4856504744277,"geometryType":"esriGeometryPoint","geometry":{"x":-10420720.130137838,"y":5161697.9950744174,"z":0}},{"routeId":"S001920030W5775","measure":0.083607366363429816,"geometryType":"esriGeometryPoint","geometry":{"x":-10420784.685730206,"y":5161854.7170099383,"z":0}},{"routeId":"S001920069S","measure":112.25235820295357,"geometryType":"esriGeometryPoint","geometry":{"x":-10420637.611032797,"y":5161727.8560461001,"z":0}}]}]}
Any help would be appreciated!
Thanks,
Mark
0
-
Hi Mark,
Just in case you are not sure how to convert the code into a workflow, please copy the code and paste it into a notepad. Then save as a .XAML file and you will be able to open it in Workflow Designer.
I hope this helps
Carmen0 -
Anyone have the code referred to in the comment by Carmen Tam? I have the same situation so an example of how to deal with this would be greatly appreciated! 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare