qc4vmware
Virtuoso
Virtuoso

Add a configuration element attribute programmatically of type array. How do I specify the array type?

Jump to solution

I am trying to add a configuration element item which is an array of strings.  I am not sure how to do this programatically and have it show as an array of strings.  I'd like for people to be able to use the vCO client and edit those if need be.  I am successful at adding the items but they show up as "uneditable".  I can retrieve everything ok programatically but I guess since an array can actually hold varying values it gets treated as the generic object instead of an array of strings.  Is there any way to force that type when I set the value via the api?  This is my test code:

var testArray = new Array();
testArray.push("string1");
testArray.push("string2");
element.setAttributeWithKey("TestKey",testArray);
This results in an attribute of type Array but I'd like it to be of type Array/string;
0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee

Paul, as far as I know, you must manually define your attribute types using the vCO client. You cannot specify types using script.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

0 Kudos
2 Replies
Burke-
VMware Employee
VMware Employee

Paul, as far as I know, you must manually define your attribute types using the vCO client. You cannot specify types using script.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
qc4vmware
Virtuoso
Virtuoso

Thanks.  I was only holding a couple of values so I went with individual attributes for each and tagged on an identifier.  Not exactly what I wanted but it works.

0 Kudos