Pulling the Full Name (Workflows)
Hello,
I’m building a workflow and I’m trying to pull the full name from an asset using the ‘item.getName()’ procedure, but this only seems to pull the Display Name. Does anyone have a workaround for this to pull an asset’s full name?
Many thanks in advance.
Chris
christopherwalters
Posted 6 years ago · Edited 1 year ago·Last reply 5 years ago
5 comments
Stijn Waegemans
·6 years ago · EditedHi Christopher,
try :
def x=assetApi.getAsset(item.id)
def fullname=x. getName()
Item is a NamedResource, so you first have to convert it to an asset
ravitejakatragadda
·5 years ago · EditedHi Stijn,
I’m building a workflow where I’m trying to pull the asset display name but I’m not getting the display name and it is pulling the full name and the asset type is a custom asset type.
Many thanks in advance.
Ravi
pmahend3
·5 years ago · EditedHi Ravi,
Following Stijn’s process, you will be able to get the Asset object using the id and then use the assetApi to get it’s display name
assetObj = assetApi.getAsset(item.getId())
displayName = assetObj.getDisplayName()
Note that the value of the item bean changes context depending on the resource the workflow runs on. Hope this helps.
Cheers
ravitejakatragadda
·5 years ago · EditedHi Pranay,
Thanks, it works for me, and one more question in the user task form I have a field and type I have given as a dynamic check box. I’m populating all values in the form and I created one specific box for select all. If I choose to select all box the remaining checkboxes need to select. Do you have any idea how to implement this functionality?
Many thanks in advance.
Ravi
pmahend3
·5 years ago · EditedHi Ravi,
I’m assuming that you’re using dynamic checkboxes to update a multiselect attribute value.
It seems like you want the form to dynamically update a part of the form when another part of the form is updated - While this won’t be possible because of the limitations of the current state of Collibra workflow forms, you should be able to update all the attributes on the backend.
Thanks