VMware Cloud Community
anoopvb
Enthusiast
Enthusiast
Jump to solution

Get a custom attribute and store it in a workflow attribute?

Hi.

Maybe I'm confused about this but from the looks of it, I can't seem to take the custom attribute that's retrieved using

com.vmware.library.vc.customattribute.getCustomField()

and assign it to a workflow attribute for use later on or for even checking the value.

From the looks of the workflow, it just logs the value.

Is there a way to do this natively in vRO?

thanks!

Anoop

1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Are you trying to retrieve the custom attribute using the workflow 'Get custom attribute' (in Library/vCenter/Custom attributes folder)?

If so, then yes, this workflow only logs the retrieved attribute and doesn't return it as output parameter. You have the following options:

  • Write your own workflow using 'Get custom attribute' as a starting point. You can duplicate it, then add a new out parameter of type string, and assign the value of customAttributeValue to it.
  • Call directly the action com.vmware.library.vc.customattribute.getCustomField() in your scripting code and use its string return value.

View solution in original post

2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Are you trying to retrieve the custom attribute using the workflow 'Get custom attribute' (in Library/vCenter/Custom attributes folder)?

If so, then yes, this workflow only logs the retrieved attribute and doesn't return it as output parameter. You have the following options:

  • Write your own workflow using 'Get custom attribute' as a starting point. You can duplicate it, then add a new out parameter of type string, and assign the value of customAttributeValue to it.
  • Call directly the action com.vmware.library.vc.customattribute.getCustomField() in your scripting code and use its string return value.
anoopvb
Enthusiast
Enthusiast
Jump to solution

Yes. I think calling the action directly from a script object i think is what i'm going to do. that way i can set a workflow attribute.

0 Kudos