How can we retrieve AD Application Ability Id(meta data)in form field

Hi guys,
I have created a form for Ad application entitlement creation. I need to retrieve Ability Id in AD Application into form field. Please help me with it.

can you elaborate on your use case and what information you need in form?

Actually my use case is Entitlement creation froms. I have created couple of forms of this use case where it selects the Application. and gives the entitlement data in form and on clicking submit the form will be submitted. But For AD Applications they want to naming type for entitlement lik a+Ability Id. This Ablity id is a unique id (meta data)in AD applications so in a form field I want to retrieve it.

Ok, so is this id stored in Application object or in a custom object. If its stored in application, then you can use do something like this in the field script

Application app = context.getObjectByName(Application.class,“Active Directory”);
// check for null
and then get value from app using getAttributeValue()

It is stored as a custom object