
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello,
Does anyone know if there is a way to retrieve the global list labels in the workflow context?
I could only find IDVault.globalList(key) that returns an Array of global list values, but no labels.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
The code I've been using was:
...
cListByName = IDVault.globalQuery(null, "CFilterByName", {"firstName":form.getValue("fcon_name")});
...
if (cListByName[0].length>0){
...
}
...
In most cases results received from portal interface APIs are stored in object containing two arrays: [0] for keys and [1] for display values. This applies to global lists too.
Notice I wasn't pushing these values through any field, cause getValues() on the other hand will return only keys. This is what description says:
The code for you to get specific description would be
IDVault.globalList(null, "listKey")[1][indexOfWhateverElementFromList]
and don't forget about locales. 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I believe you have to play a bit with the returned object. AFAIR it is a array of arrays and to get to proper list you need to use result[0] to get keys or result[1] to get the labels. Not specifying index gives you the first, as you have noticed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I tried the field.getValues() function with all the syntaxes I could think of ( 0, "0",[1],"[1]").
It turns out that in any case it always returns me the value (key) of the selected GlobalList field.
Is that the function you're talking about ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
The code I've been using was:
...
cListByName = IDVault.globalQuery(null, "CFilterByName", {"firstName":form.getValue("fcon_name")});
...
if (cListByName[0].length>0){
...
}
...
In most cases results received from portal interface APIs are stored in object containing two arrays: [0] for keys and [1] for display values. This applies to global lists too.
Notice I wasn't pushing these values through any field, cause getValues() on the other hand will return only keys. This is what description says:
The code for you to get specific description would be
IDVault.globalList(null, "listKey")[1][indexOfWhateverElementFromList]
and don't forget about locales. 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I know this is an old post, but I thought I'd start here.
I do not believe the answer provided is the correct solution. The solution given is for using IDVault.globalQuery in a form element, not in the workflow. I can tell because the example is using length and is accessing array elements with the [x] notation. In the workflow, IDVault.globalQuery returns a java.util.ArrayList object. You need to use size() with this type of object and you access the elements of the array with this notation : object.get(x)
Did the original poster, or anybody else for that matter, figure out how to access the label values within the workflow?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Best regards
Michiel Los

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Yes. That is what I am doing, but the object that is returned only has the values, not the labels. The object returned in the form is a multidimensional array that contains the values and the labels. This object does not appear to be multidimensional, or I just don't know how to access the labels.