Autopopulate form

Which IIQ version are you inquiring about?

Version 7.3

Share all details related to your problem, including any error messages you may have received.

I have a form that requests the users last name, first name, etc, I want to prepopulate this form with the attributes that are connected to the user id. I am not very good with beanshell, is there a good resource or sample code available to help me create this script for each attribute?

My current code is

import sailpoint.object.*;

SailPointContext context - SailpointFactory.getCurrentContext();
Identity subject = context.getObjectById(Identity.class,identityId);
return subject.getAttribute("lastname"));

But that causes an error when requesting the role. Is there a good log to view the errors? I cant seem to find them, I am running out of a container.

If this form is part of a workflow or invoked via quicklink, then you can use the create an identity model and use that to prepopulate all the available attributes.

It is a part of a provisioning policy requesting a role. I dont believe I have access / am using workflows or quicklink.

Hi @crbrodie

In this case, if this code is a part of provisioning policiy, you have two ways for reference identity values in the fields of the provisioning form.

1.You can reference a rule of type FieldValue . This rule receive identity object as param , so you can return any atribute in this rule

2.You can set Script value, so, also you can return any identity attribute in the following way:

return identity.getAttribute("AttributeName");

If you need firstname/lastname you can just use return identity.getFirstname() or return identity.getLastname() for more methods you can check Identity class in javadoc.

Trying only

 import sailpoint.object.*;
 String last = identity.getLastname();
 
 return last;

Is still not pre-populating anything in the form. checking the logs, I am seeing this error:

sailpoint.tools.GeneralException: Error getting WebTarget from ConnectionManagersailpoint.tools.GeneralException: Missing value for hostname

I am runnining out of a container, did i miss some config? When i go to Admin Console > Environment
I see my container and the hostname is set to the same name as the server its running off of.

I have tried this as well with no luck. Do I need to instantiate the identity object anywhere for this to work?

I just found out it is populating the information in the database, so the script is working, however when the user goes to fill out the form they do not see that value, is there something I need to do to have the user see the prepopulated info in the form?

I figured it out… for anyone with a similar issue, change the form type to application in the debugger and attach it to the application provisioning policy, when creating the form the type settings need “review required” checked to see the data prepopulated.

Thanks for the help all!