Display form field only for specific user (Depending on attibute)

Which IIQ version are you inquiring about?

*[Replace this text with your version of IIQ. 8.2

Hello all,
I have some forms in my sailpoint with several fields.
I added a new field but it should only be shown to users in a certain group.
Is it possible? If yes how?
Thank you all

@RIsidoro

You can have a script attached to hidden tag for the field and within that return true for all the users who are not part of the group you intended for.
You can use launcher variable to check this

1 Like

Hi @RIsidoro,

In addition to what was mentioned by @iamksatish which is a very valid and accurate one, however, you can make another Form with the same WFs with changing the fields or hiding them and just controlling the visibility via the quick links populations - as an alternative thing.

Have a nice and great one!

Hello
That seems a good option.
But how can I know the user that is login for then to check his Workgroup ?

You can use the launcher variable of the workflow from quick link being passed to this form

I tried something like

SailPointContext context = sailpoint.api.SailPointFactory.getCurrentContext();
        Identity loggedInUser = context.getObjectByName(Identity.class, context.getUserName());

But dont seems to work.
I believe there in no context and There in no workflow running

You could do something like this:

<Field displayName="My Field" name="myField">
  <Attributes>
    <Map>
      <entry key="hidden">
        <value>
          <Script>
            <Source>
              import sailpoint.object.*;

              Identity id = context.getObjectByName(Identity.class, context.getUserName());
              Identity wg = context.getObjectByName(Identity.class, "My Workgroup");
              
              if (wg != null) {
                return !id.isInWorkGroup(wg);
              }

              return true; // Default hide
            </Source>
          </Script>
        </value>
      </entry>
    </Map>
  </Attributes>
</Field>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.