Changing role field in custom form - filter options from startsWith to anywhere

Hi Everyone,

We are using IIQ 8.3.2.

I have a question regarding field in custom form (Workflow form). It is standard field with type “Bundle”. The thing is that if you start typing in that field, you get possible roles looked up in a list. The search is done using filter startswith. So only roles starting with that typed string will be shown.

Question is, if it’s possible to change the behavior of search in order to look for roles that contains typed string anywhere? So in Sailpoint filter language, to change search mode from StartsWith to Anywhere.

We’ve tried to change it in SystemConifguration xml in attributes SearchInputDefinition, but it seems that it’s not affecting the way custom forms work.

Share your custom form xml

Here yo go. I removed the rest of form, since it’s not affecting how this field works.
Role Dashboard.xml (580 bajtów)

Hi @pszupiluk,

The “Contains” filter is not working on the bundle object. In your custom form, you can modify the type from bundle to string and write a logic to return the role name.

<Field displayName="Role Name" dynamic="true" filterString="" helpKey="Please select an Role Name" name="roleName" postBack="true" type="string">
            <AllowedValuesDefinition>
              <Script>
                <Source>
                  import java.util.List;
                  import java.util.ArrayList;
                  import sailpoint.object.Application;
                  import sailpoint.object.Identity;
                  import sailpoint.object.Link;
                  import sailpoint.object.QueryOptions;
                  import sailpoint.object.*;
                  import java.util.Iterator;
                  import java.util.Collections;

                  List finalList =new ArrayList();
                  Bundle bundle;
                  QueryOptions qo=new QueryOptions();
                  Filter filter = Filter.eq("type", "business");
                  qo.addFilter(filter);
                  List bundleList = context.getObjects(Bundle.class,qo);
                  if(bundleList!=null){
                  Iterator it=bundleList.iterator();
                  while(it.hasNext()){
                  bundle = (Bundle) it.next();
                  if(null != bundle){
                  finalList.add(bundle.getName());
                  }									
                  }
                  }             
                  Collections.sort(finalList);
                  return finalList;

                </Source>
              </Script>
            </AllowedValuesDefinition>
          </Field>

With help of this, you can find the role name using contains filter.

Regards,
Arun

Hi @Arun-Kumar

Problem with approach you described is that you have to fetch full list of names of roles from database. In our case that list would be huge. Form would take a lot to show and would work very slow (if it would even work at all).

Regards,
Piotr

I agree, if the role list is huge, it will take a long time to load. We should leverage filters to narrow down the role list

@pszupiluk

Is your requirement, if you give sub string of name as well, you have to show in the dropdown of form correct? if this is the case its tricky and I dont see a direct way to do this

If its intention is not that and as per code given by @Arun-Kumar just to fetch all Business roles, you dont need this code which will cause performance issues and no need to use Iterator as well , you can directly use filterString attribute, but as per my understanding your ask is not to display the roles

Because I see responses are not as per the question asked, correct me if my understanding on Substring is wrong