Get Domain Value Label pairs as a dictionary for lookup
I'm trying to get the domain value label pairs from our MapServer. So far, I've grabbed them using the getCodedValueDomain activity, however; after that point I'm a bit stuck.
My problem is, I'm not trying to pass it into a drop down list or other form item. I'm just trying to create a dictionary that I can use to look up what the values are which I will later use for string concatenation and assigning to a text box.
At the moment, the dictionary uses sequential numbering as the keys for the dictionary and then the values are a dictionary with a value and label pair.
First Item: 0:{value: "AG", label: "Agricultural"}
What I'm trying to get: {"AG": "Agricultural", ... }
So I can do: dictionary["AG"]
Which gives me: "Agricultural"
I've been trying to do a "ForEach" through the dictionary and assign the value as the key and the label as the value into a new dictionary, but I don't think Workflow 5 can handle that without a custom activity.
Is there another way to do this without hard coding a dictionary in a createValue activity?
Thanks!
-
Hi Odiri,
I've attached an example for creating a dictionary like you mentioned. Use File > Import in workflow designer to open it. The log activities in there aren't necessary, they're just to help the troubleshooting process if anything fails (it's sometimes hard to track down what went wrong when you're using a For Each).
I would also suggest posting an Idea to https://communities.geocortex.com/workflow/s/ideas to request a dictionary output from the Get Coded Domain activity, to make the process easier in the future. There might be other folks who want to use coded domains in a similar way so it would be helpful for us to collect that feedback on the Ideas board.
0 -
Hey Amanda,
Got it working! Thanks for the help!
Yes, the log activity is a lifesaver. Good for locating those "undefined activity" errors too.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare