VMware Cloud Community
michael_stefani
Enthusiast
Enthusiast
Jump to solution

ASD Request a Catalog Item and custom properties

Just curious if anyone else has run into issues with custom properties when using the ASD and the request a catalog item action.  For example we're setting the business group name in a custom property by using {custom.vCAC.BusinessGroup.Name} as the value of a custom property.  When requesting a blueprint the traditional way this gets calculated and the business group name ends up in that field.  But when requesting the same blueprint through the ASD it doesn't evaluated.  I get "{custom.vCAC.BusinessGroup.Name}" as text in the field.  Anyone found a workaround to this?  Thanks,


Mike

0 Kudos
1 Solution

Accepted Solutions
Craig_G2
Hot Shot
Hot Shot
Jump to solution

Custom properties aren't passed through by default with ASD.. you get 5 "global variables"....

_asd_tenantRef

_asd_subtenantRef

_asd_catalogRequestId

_asd_requestedFor

_asd_requestedBy

_asd_subtenantRef is the id of the business group..

You could grab the name like this...

var vCACCAFEBusinessGroupId = System.getContext().getParameter('__asd_subtenantRef');

var vCACCAFEBusinessGroupObject = vCACCAFEEntitiesFinder.getBusinessGroup(vCACCAFEHost, vCACCAFEBusinessGroupId);

var businessGroupName = vCACCAFEBusinessGroupObject.name;

System.log(businessGroupName)l

To pull back custom properties you could do this

var customProperties = new Properties();

customProperties = vCACCAFEBusinessGroupObkect.getCustomProperties();

This returns an array of properties..

You can then loop through each properties object in the array and get the key/value

Hope that helps in some way!

View solution in original post

0 Kudos
4 Replies
michael_stefani
Enthusiast
Enthusiast
Jump to solution

Sorry just for a little more clarification custom.VCAC.BusinessGroup.Name is a custom field that's being set at the Business Group Level.  It's when we're trying to assign a 2nd custom field the value of that one (and others) that we get the literal value in our fields.

Mike

0 Kudos
Craig_G2
Hot Shot
Hot Shot
Jump to solution

Custom properties aren't passed through by default with ASD.. you get 5 "global variables"....

_asd_tenantRef

_asd_subtenantRef

_asd_catalogRequestId

_asd_requestedFor

_asd_requestedBy

_asd_subtenantRef is the id of the business group..

You could grab the name like this...

var vCACCAFEBusinessGroupId = System.getContext().getParameter('__asd_subtenantRef');

var vCACCAFEBusinessGroupObject = vCACCAFEEntitiesFinder.getBusinessGroup(vCACCAFEHost, vCACCAFEBusinessGroupId);

var businessGroupName = vCACCAFEBusinessGroupObject.name;

System.log(businessGroupName)l

To pull back custom properties you could do this

var customProperties = new Properties();

customProperties = vCACCAFEBusinessGroupObkect.getCustomProperties();

This returns an array of properties..

You can then loop through each properties object in the array and get the key/value

Hope that helps in some way!

0 Kudos
Craig_G2
Hot Shot
Hot Shot
Jump to solution

That last bit was wrong..

This

var customProperties = new Properties();

customProperties = vCACCAFEBusinessGroupObkect.getCustomProperties();

should be this

var customProperties = new Array();

customProperties = vCACCAFEBusinessGroupObject.getCustomProperties();

customProperties is an Array of vCACCAFECustomProperty

So you can easily loop through it like this 🙂

for (var i in customProperties){

     System.log(i.name + " : " + i.value);

     }

0 Kudos
michael_stefani
Enthusiast
Enthusiast
Jump to solution

Thanks for the info, we've worked around it too.  Good to know that the custom properties aren't passed through though.  Thanks,

Mike

0 Kudos