Group Id to Group code

Currently we use group id and cloud id (zoneId) in our catalog to launch resources in different cloud and group. If we want to use Group Code, then currently we need to take another input with code, is it possible to infer group code from group id instead without any additional input?

You could do something like this in your Translations Script of your Option List

var i=0;
results = [];
for(i; i<data.length; i++) {
  results.push({name: data[i].name, value: data[i].id + ":" + data[i].code})

This will display the group name in the dropdown and the value will look something like {{group_name}}:{{group_code}}

You could then use a split function in your catalog config on the “:” and take index 0 or 1 to get the id or code

@sjabro Thanks. can you please provide an example in catalog config as well?

Example for conditions and spliting customOptions value

<%= if(customOptions.fieldName.tokenize('|')[1] == 'vmware') {'xx'} else {customOptions.fieldName.tokenize('|')[0]} %>

@aabraham Thanks. Any confluence document where can I find more of this? What language is being used and any built in functions? I will test this out and let you know the outcome.